Install and run WordPress locally in Mac OS X using MAMP
Since the start of 2008, I’ve run into some client requests to develop their websites based on the de facto blogging engine, WordPress. As such, it was required that I be able to create and test custom Content Management System themes locally on my PowerBook G4 without having to be online. A boon considering some places I go to don’t have web access or have ridiculous firewall policies blocking access to some WordPress administration pages.
In case you’re wondering, MAMP stands for “Macintosh, Apache, Mysql and PHP”. It enables Apache server with PHP and a MySQL server to run without the need for an online web server. Mac OS X Leopard already has Apache pre-installed, in fact its what you use when you enable Web Sharing, but it’s not as straightforward to enable and configure as compared to MAMP’s one-click solution. Also, you’ll still need to install the latest MySQL and PHP separately with Leopard’s Apache – something quite tedious and not for the faint-hearted. Unless you need full control over your entire Apache/PHP/MySQL, MAMP is simply the best way to go.
Here’s the way to install MAMP and configure WordPress to run off your local hard drive. It really isn’t difficult; in reality, it’s quite painless.
Download MAMP for Mac OS X from www.mamp.info, the free version (as opposed to the US$XX Pro version) is good enough for running WordPress and testing.
After downloading the 100+ Megabyte package, continue to install MAMP. After installation, open the MAMP Control Panel App inside the MAMP Folder in your main Applications folder. There’s also an included Dashboard Widget that works the same way as the main Control App.
Now click on the “Start Servers” button. The red icons on the side should turn to green when the Apache and MySQL servers are ready.
Safari (or whatever your default browser is) should open with the MAMP Start Page. If it doesn’t open automatically, just click on the “Open start page” button. Don’t worry about the confusing tabs and options in that page, we only need to concern ourselves with Start Page and the phpMyAdmin page (link is located on the menu at the top of the page).
Take note of the following information on the Start Page:Host: localhost
[Port: 8889]
User: root
Password: root
You can write this information down, you’ll be needing it later for configuring WordPress’ wp-config.php file.
Click on the phpMyAdmin link at the top of the page. After the page loads, look for the only text field on the page to “Create new database”. Enter a name for the database that we’ll use for the WordPress installation. Click “create”.
Go to the Finder and open the MAMP Folder, inside this is the “htdocs” folder. Open “htdocs” and make a new folder – to make things easy, let’s name this “wordpress”. We’ll be installing WordPress here. Decompress WordPress and install all the necessary files (the wp-xxx files and folders).
Open the wp-config-sample.php file in any text editor and change the settings in the “MySQL Settings” to match the information provided from the MAMP Start page. Make sure you put in the exact name in the database name field that we created in phpMyAdmin. Save the file inside thehtdocs -> wordpress folder as “wp-config.php”.
Return to your browser and enter http://localhost:8888/wordpress/ into the address field. If everything went well you should be presented with the WordPress Installation process.
Just follow you’re usual installation process like you would do if you were installing WordPress on an actual web server.
That’s pretty much it! When you’re done just click on “Stop Servers” from the MAMP Control app.
If you want multiple installations of WordPress, just follow the same procedure above but use a different name for both the database and the folder inside “htdocs’.
Install and run WordPress locally in Mac OS X using MAMP
Since the start of 2008, I’ve run into some client requests to develop their websites based on the de facto blogging engine, WordPress. As such, it was required that I be able to create and test custom Content Management System themes locally on my PowerBook G4 without having to be online. A boon considering some places I go to don’t have web access or have ridiculous firewall policies blocking access to some WordPress administration pages.
Here’s the way to install MAMP and configure WordPress to run off your local hard drive. It really isn’t difficult; in reality, it’s quite painless.
[Port: 8889]
User: root
Password: root
That’s pretty much it! When you’re done just click on “Stop Servers” from the MAMP Control app.
If you want multiple installations of WordPress, just follow the same procedure above but use a different name for both the database and the folder inside “htdocs’.
I hope this information was helpful! Keep coding!