How to install WordPress + PHP + mySQL to a local development server environment on Windows or Mac, in 5 minutes

by marc on April 19, 2011

This is so easy it will knock your socks off. It took me 15 minutes, but that was because I wasn’t clear on mySQL security – it should take 5 minutes. I did it because I was doing a lot of development with short testing cycles and was tired of the server lag-time of my remote server.

Note: if the instructions below don’t work for you, try XAMPP.  Note also that there appears to be an incompatibility between WampServer and Skype (disable Skype) and Mac users need to refer to their local website as http://127.0.0.1.  On Windows 7 or higher you may want to try WebPI also (on older computers it will download too much stuff)

Windows Instructions (Mac instructions below)

  1. Download and install WampServer (Windows / Apache / mySQL / PHP – all in one bundle for Windows!)
  2. Start WampServer. In Windows, the icon will now appear in your taskbar: image
  3. Point your browser to http://localhost
  4. Click on “phpmyadmin” on the lower left
  5. Immediately enter a new database name on the first screen (let’s call it “wp2”) and then Create.
    image
    You are now done with mySQL – no need to create a mySQL user as you would on a regular hosting account, as you will be using the root mySQL user
  6. Download and unzip latest WordPress. Ignore the instructions – just listen-up here
  7. The install file unzips to a directory called wordpress. Copy and paste this directory into your root web server directory, which is normally c:\wamp\www. So you now have a directory at c:\wamp\www\wordpress
  8. Point your browser to http://localhost/wordpress and proceed through initial screens (it will ask you to create a wp-config.php file).
  9. Enter the database name you entered in Step (“wp2”) and Database user (“root”). Leave everything else as is and click “Submit”.
    Mac users enter “root” for the password as well (Windows user leave the password blank)
    image
  10. Hit “Continue” until the end. Make a note of your (auto-generated) password.

You are done. You can now enter your WordPress dashboard (http://localhost/wordpress/wp-admin) and from there install themes or plugins directly from your dashboard, just as you would normally.

Mac Instructions

  1. Download and install MAMP (Mac / Apache / mySQL / PHP).
  2. After starting MAMP, by default it should automatically load the “MAMP Start Page”. If it doesn’t, click Open start page.
    image
    image
  3. Navigate to the phpMyAdmin tab and create a database for your local WordPress installation. In this example below the database is called “wp2”. Click Create.
    image
  4. Download and unzip the latest WordPress. Put the decompressed folder wherever you want. I recommend putting it in “/Users/(your user name)/Sites/“ You’ll link to it in Step 6.
  5. Return to MAMP, go to Preferences and check Ports. Click Set to Default Apache and MySQL Ports (the default ports should be: 80 for Apache/HTTP, and 3306 for MySQL)
    image
  6. Go to the Apache tab and select the location of your Sites folder (see Step 4). Click OK.
    For example: If you point Apache to the folder /Users/(yourusername)/Sites/, and inside that folder you put the unzipped wordpress folder, then you access it in your browser at http://localhost/wordpress.
    image
  7. Now point your browser and navigate to http://localhost/wordpress and then follow the Windows instructions above from Step 9 to install WordPress.

(Mac instructions kind courtesy of Collin Burton)

Very cool – thanks to the good folks at WampServer and WordPress.org.

Comment on Facebook!

{ 6 comments… read them below or add one }

Neal Fo November 2, 2011 at 4:30 pm

Just followed the instructions for Mac. All went well till I had to point my browser to http://localhost/wordpress. Page came up with a “Not Found”. Any ideas? BTW, I’m on Mac OS 10.5.8 using the MAMP that corresponds to that OS. And I’m using the latest WP. Don’t know if that’s the problem.

Reply

marc November 2, 2011 at 5:00 pm

I think for Mac you need to use http://127.0.0.1

Reply

Mick November 15, 2011 at 10:42 pm

Hi, I just installed WAMP, and I got to http://localhost but it is not letting me get to phpmyadmin…I’m running Windows 7, do I have to do anything else?

Reply

marc November 16, 2011 at 12:34 pm

On Win7 I would advise Windows PI (Platform Installer) for WordPress.

Reply

Mick Roberto November 16, 2011 at 12:16 pm

I can’t get access to phpmyadmin…I’m running Win7 and it’s giving me a 403 Forbidden error…help?

Reply

Monique January 7, 2012 at 5:11 pm

Thank you so much for posting this! Super easy, clear and helpful and I am now up and running locally!

Reply

Leave a Comment

Neal Fo November 2, 2011 at 4:30 pm

Just followed the instructions for Mac. All went well till I had to point my browser to http://localhost/wordpress. Page came up with a “Not Found”. Any ideas? BTW, I’m on Mac OS 10.5.8 using the MAMP that corresponds to that OS. And I’m using the latest WP. Don’t know if that’s the problem.

Reply

marc November 2, 2011 at 5:00 pm

I think for Mac you need to use http://127.0.0.1

Reply

Mick November 15, 2011 at 10:42 pm

Hi, I just installed WAMP, and I got to http://localhost but it is not letting me get to phpmyadmin…I’m running Windows 7, do I have to do anything else?

Reply

marc November 16, 2011 at 12:34 pm

On Win7 I would advise Windows PI (Platform Installer) for WordPress.

Reply

Mick Roberto November 16, 2011 at 12:16 pm

I can’t get access to phpmyadmin…I’m running Win7 and it’s giving me a 403 Forbidden error…help?

Reply

Monique January 7, 2012 at 5:11 pm

Thank you so much for posting this! Super easy, clear and helpful and I am now up and running locally!

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>