Install WordPress Locally With XAMPP Pt.1

Install WordPress Locally With XAMPP

This is Part 1 of a 2 part tutorial.

Back in December of 2008 I showed you how to install WampServer and WordPress on your PC in a tut called Installing WordPress Locally. I thought it was time to revisit the topic but this time I’ll show you how to do it using XAMPP.

Having WordPress running in a local environment is a good idea for several reasons,

  1. Maintaining a clone of your live blog.
  2. Testing new functionality such as themes or plugins without affecting your live blog.
  3. General experimentation.

I currently have over a dozen instances of WordPress on my computer including two SVN flavours.

As I said in the original article WordPress is not an executable. It is a software package written in PHP meaning it needs a few things to operate. The minimum requirements for WordPress 3.0.4 are:

  • PHP version 4.3 or greater
  • MySQL version 4.1.2 or greater
  • a server that supports PHP and MySQL preferably Apache

XAMPP will install these things for you. Now that we’re ready let’s begin. Head over to the Apache Friends website and download the XAMPP for Windows package. At the time of this writing it is version 1.7.3. For the purposes of this tutorial we will be using the EXE version that weighs in at 51 MB. You’ll find it under Basic Package.

After you have downloaded the EXE to your hard drive, double click the XAMPP icon to begin the installation. After double clicking the XAMPP icon you will see the screen below,

Choose the default directory

It’s pretty self-explanatory. It’s asking you what directory you want to install XAMPP in. Go with the default which is C:\ When ready click on Install. The procedure will take several minutes depending on your system so be patient.

Once the various files have been unpacked and set up you will be presented with a series of dialogue boxes.

The first one you will see is the image below,

Add shortcuts Yes or No

In the above screen it is asking if you want to add shortcuts to your desktop and start menu. I chose yes. Make your selection and hit Enter.

Next up is the screen below,

Locate the XAMPP paths correctly

In the above screen it is asking you if it should locate the XAMPP paths correctly. Choose the default which is Yes. Hit Enter.

After that you will see the following screen,

Make a portable XAMPP without drive letters?

In the above screen it is asking if it should make a portable XAMPP without drive letters. Pay special attention to the Note on that screen. If you plan on using services you must choose No, which is the default. I chose No because I want the services and don’t plan on using USB sticks. When done hit Enter.

Now you will be shown the next screen below,

Relocating the various paths

When it has finished relocating the various paths hit Enter.

After that you will be presented with the screen below,

Setting the timezone

In the above screen it is telling you that it set the timezone in php.ini and my.ini to America/Chicago and that you should correct it if it is wrong. We’ll worry about that later. Hit Enter.

After hitting Enter you will see the following screen,

XAMPP is ready

In the above window it is telling you that XAMPP is ready to rock and roll. Select option 1 and hit Enter. This will start the XAMPP Control Panel which sits at the bottom right corner of your screen when maximized. From here you can access the various functions. See the image below,

XAMPP Control Panel

You may see a warning from your firewall – grant permission to both Apache and MySQL. To minimize the Control Panel to the taskbar click the red x in the top right corner.

We now have a functioning server and database installed on our computer.

At this stage you may want to configure a few things such as password protection. Navigate to http://localhost/xampp/ and select your language. I chose English. You are now at the XAMPP welcome page.

From the XAMPP welcome page click on Security in the menu on the left side of the page. See the image below.

Click on Security

After clicking on Security you will see the screen below advising you of security problems. (click image to enlarge)

Uh oh!

Don’t worry, this is easy to fix. Navigate to http://localhost/security/xamppsecurity.php Once you navigate there you’ll see the screen below,

Choose your passwords

It is in the screen above that you can set your passwords. Referencing the image above, under the heading MYSQL SECTION: ROOT PASSWORD is the password you’ll need to access phpMyAdmin. Choose a password and enter it. Don’t forget that password because we’ll need it again later when we install WordPress. For the options entitled phpMyAdmin authentication and Set a random password for the phpMyAdmin user pma you can go with the defaults. If you want you can tick the box where it asks if you’d like to store your password in the directory shown. When you’re finished click on Password Changing.

Still looking at the image above, let’s go down to the section entitled XAMPP DIRECTORY PROTECTION. Select a username and password and enter them. Again, if you want to, tick the box where it asks if you’d like to store your password in the directory shown. When you’re finished click on Secure the XAMPP directory.

At this point you will need to restart both Apache and MySQL for the changes to take effect. All you need to do is open the XAMPP Control Panel and click on Stop beside both Apache and MySQL. Wait a few seconds then click Start beside both Apache and MySQL.

Okay, now let’s test it. Navigate to http://localhost/xampp/ If everything works correctly you should see a dialogue box asking for your login credentials. See the image below.

XAMPP Login

Enter the username and password you chose earlier. Those will be the values you selected under XAMPP DIRECTORY PROTECTION.

If you entered the correct username and password you should now be back at the XAMPP welcome page.

You can access phpMyAdmin in one of two ways:

  1. While at the XAMPP welcome page, click on phpMyAdmin in the menu on the left
  2. Navigate directly to http://localhost/phpmyadmin/

Either method will take you there. When you arrive at the phpMyAdmin screen it will ask you for your login credentials. See the image below,

phpMyAdmin login

The username you will need is root and the password is whatever you chose earlier. It will be the value you entered under the heading MYSQL SECTION: ROOT PASSWORD.

Congratulations! XAMPP is installed and configured along with a fully functioning Apache and MySQL.

In Part 2 of this tutorial we will install WordPress on your computer. Stay tuned for that.

further reading:
http://www.apachefriends.org/en/faq-xampp-windows.html
http://www.apachefriends.org/f/viewforum.php?f=16

Go to Part 2 of this tutorial.

About Len Kutchma

Len has been blogging for over 10 years and is a rabid WordPress fan. In addition to blogging here you can find him writing the occasional article and toiling away in the forums at WeblogToolsCollection.com. He also hangs out at the WordPress support forums lending a hand when he can. You can also find him at Google+ Twitter and GitHub.

Comments

  1. Samuel Marks says:

    Hey Len,

    Some helpful information there!

    Found your post by Googling and setting the limit to “within 24 hours”, as last time I researched this topic; the tutorial was for obsolete ⊕ outdated versions.

    If you get the chance, could you also write a tutorial for setting up Question2Answer within WordPress on XAMPP?

    [possible pt3 to this tutorial]

    Thanks again for a great tutorial, keep bloggin’ ;) ,

    Samuel

  2. Len Kutchma says:

    Glad you found it useful Samuel.

    “If you get the chance, could you also write a tutorial for setting up Question2Answer within WordPress on XAMPP?”

    That’s a good idea.

    • Samuel Marks says:

      Thanks =]

      Should be a pretty short tutorial, ie; how to integrate with SSO (WordPress) and how to integrate with your WordPress theme.

  3. I want to thank you for your tutorial. I had many problems trying to install XAMPP V1.7.4 (3 weekends of endless frustration) I finally decided to use the previous version 1.7.3 and searched for any info I could find to follow for the set up. I’m so glad I found your site. Many other install tutorials were either obsolete or left out steps, or both, yours did not.

    BTW I’m using Win 7 32 bit.

    I’m looking forward to following Part 2.

Trackbacks

  1. [...] have a look at our easy to follow 2-part tutorial called Install WordPress Locally With XAMPP – Part 1 and Part [...]

What Do You Think?

*

Please read the Comment Policy before submitting a comment.