Running WordPress on Mac OS X with XAMPP
Experimenting on the theme, layout and widgets on a live WordPress blog is never a great idea as there is always the risk of not being able to roll back to your previous layout and widget configuration. A lower risk way to experiment is to host and run a copy of your WordPress blog locally on your Mac, this way you can hack away with zero risk to your live blog. The XAMPP bundle makes this very easy to setup:
- Download XAMPP for Mac OS X from http://www.apachefriends.org/en/xampp.html.
- Open the xampp dmg file and copy xampp into the applications folder.
- Run the xampp control app and start apache & mysql.
- Using your browser, go to http://localhost/xampp/splash.php
- Select your language then click phpMyAdmin.
- Create a database called ‘wordpress’ using ‘utf8_unicode_ci’ collation.
- Download WordPress from http://wordpress.org/download/.
- Unzip WordPress into /Applications/XAMPP/htdocs/.
- Copy the following details into your wp-config file, and save it as wp-config.php These are the exact details you need for Xampp to work because the default user in phpmyadmin is called ‘root’ and there is no password:
- DB_NAME is ‘wordpress’.
- DB_USER is ‘root’.
- DB_PASSWORD is ”.
- DB_HOST is ‘localhost’.
- In your browser, go to http://localhost/wordpress/wp-admin/install.php to install WordPress.
- Once WordPress installation is complete go to http://localhost/wordpress/ to verify the installation.
- To get automatic updates of WordPress and installation/updates of plugins and widgets working do the following:
- Make a note of your username e.g. ‘Daniel’.
- Open /Applications/XAMPP/etc/httpd.conf as root/admin e.g. “sudo open -e ‘/Applications/XAMPP/etc/httpd.conf’” from terminal.
- Find the following lines:
User nobody
Group admin - Change the lines to the following:
User <Your Username>
Group staf f - Save the file. Some people are having issues with TextEdit preventing edits to the file due to file ownership, there are two possible work arounds:
- Use another text editor like vi to make the required edits the file: ”sudo vi ‘/Applications/XAMPP/etc/httpd.conf’”.
- Use the chown command to change the file’s ownership: “sudo chown <Your Username> ‘/Applications/XAMPP/etc/httpd.conf’”.
- Restart XAMPP and visit http://localhost/wordpress/ you should now have a fully functional WordPress installation you can experiment on without effecting your live blog.
The next step is to mimic the configuration of the live blog on the test blog by:
- Importing the posts and comments from the live blog.
- Installing the same theme, widgets and plugins.
- Configuring the theme, widgets and plugins.
You can now start hacking away on your test blog without worrying about breaking your live site!
Responses are currently closed, but you can trackback from your own site.







Thanks for the awesome instructions, I was able to setup XAMPP on the Mac and install WordPress. However when I get to step 12 and try to make the changes to the httpd.conf file I can’t save the changes. I followed your instructions, I’m singed on as SU and I have even changed the file permission on the entire XAMPP directory…any guidance would be greatly appreciated.
You can check what group your user account is in by running the command ‘groups’ in the terminal window. Perhaps your not in the ‘staff’ group?
Hello,
I’m actually stuck at step 10. Instead of getting a page that’s helpful, I get an “Object not found” message.
Help?
Did step 6 (phpmyadmin) work for you? Or did it have errors too? If phpmyadmin worked then php is probably okay.
Next thing to check is that the ‘/Applications/XAMPP/htdocs/wordpress’ directory created in step eight is present. And that it has a subdirectory called ‘wp-admin’ with a file called ‘install.php’ which is what your calling step ten.
Hi Daniel, thanks for posting this guide- it seems easy enough for a beginner like myself to follow. However, could you please clarify step #6? I don’t know what ‘utf8_unicode_ci collation’ means. Thank you again!
-Paula
Hello Paula,
There should be a drop down menu labeled ‘collation’ beside the text box for entering the new databases name. Set that option to ‘utf8_unicode_ci’.
-Daniel
This is very clear and concise, and helped me solve the auto-update issue, thanks!
I’m trying to set up my local network as a development environment, hosting Xampp on my MacPro but I’d like to have full access from my laptop too. I’m able to see the WordPress site from the laptop using http://(macpro ip address)/wordpress/ but the template does not load, it’s showing unstyled pages, as if the css is missing. Links revert to “localhost” as well.
Any tips on viewing a Xampp installation from a different computer? I’ve moved from Mamp to Xampp for this purpose.
Found it! The trick is to change WordPress >General Settings, both WordPress address and Site address to your host computer IP address. By default it says “localhost” but for computers on the network to see it, it must be IP address.
Hi, thanks for making this so simple. Been searching a while for a solution on this. Just started working on Mac, but have been using XAMPP on windows for a long time. So, on a Mac it was a bit different.
Thanks. Bookmarking
Hi Daniel. Good article on how XAMPP. I’m pretty big on it myself. You might like my twist on it as I’ve tossed in an ‘easy’ wizard to create friendly “fake” domain names for working on more then one site (and who doesn’t these days). It also features an intelligent copy feature just for WordPress (it scrubs your database posts, pages for re-mapping to a new domain). Check it out!
http://serverpress.com
Oh, and the aforementioned features are free.
I didn’t try this yet, but about to…..do you then know how to export that file onto network solutions?
I’m not sure what you mean by ‘network solutions’.
[...] running. There are a variety of ways to do this, but I use the approach of installing XAMPP. Here’s a tutorial on that. Follow the rabbit trail to configure Apache to look to your Sites directory, as I have, or make [...]
You are a champion man! Thanks, I’ve been sitting for hours trying to get XAMPP and WordPress working correctly on Mac.
On Windows, I have no problem.
Hello!
I just recently installed xampp and followed your instructions above. (Its been very helpful) Although I stopped at #12 (im a newbie so i couldn’t understand it in full
) Anyway, I tried uploading a theme I downloaded before but I can’t seem to upload it. I get this error message:
Unable to create directory /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/uploads/2012/04. Is its parent directory writable by the server?
What does this mean? Have I done something wrong? Any help is greatly appreciated. Thank you!
You need to do step twelve to give WordPress sufficient permissions to write to disk.
Having issue with step 12…won’t let me alter that file because it is locked. Keep getting:
Unable to create directory /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/uploads/2012/04. Is its parent directory writable by the server?
Hmm, I get the locked file issue with step 12 too since I upgraded to Mac OS 10.7.3. A work around that worked was to use vi to edit the file but its certainly not a beginner friendly text editor!
Another solution is to use the chown command to change the ownership of the file. I’ve updated the guide..
THANKS!!!!
I spent 4 hours messing around scared to sudo change files to 777.
THANKS!!
Simple, easy, AND MY WORDPRESS WORKS!!!!
Could you please clarify step 12? I’m not sure how to open the .conf file to make those changes.
The open command should cause the file to be opened by the appropriate editor.