Local Development: Installing XAMPP

image There will come a time when the beginner blogger wants to take more control and choose to host their own blog. When it comes to development, testing design tweaks, different templates, plug-in compatibility and overall usability, nothing beats having a version of your blog sitting on your very own desktop (or laptop) computer. The easiest way to host a local version of your blog on Windows is to use the popular local server package XAMPP. This post will explain what XAMPP is and does and will give the reader a step by step tutorial on installing XAMPP on Windows.

What is XAMPP?

XAMPP is a variation of the commonly used acronym LAMP which stands for Linux, the Apache web server, the MySQL database and the languages PHP and Perl. Many websites run on a variation of LAMP (or the not quite as popular WAMP for Windows etc.). XAMPP runs on multiple platforms (hence the ‘X’) and installs versions of Apache, MySQL, PHP and Perl specifically tailored to run on your local machine rather than on a server openly available on the internet. The emphasis on local installation also means that XAMPP is inherently insecure and should not be deployed on systems accessible from outside your own network.

Some of you reading this may have tried to install all of these components separately and came to the same conclusion I did: it’s hard and generally not worth the time and effort invested. XAMPP makes all of this extraordinarily easy and the rest of this post will show you just how easy it really is.

Installing XAMPP

Although XAMPP is available for Windows, Mac OSX, Linux and Solaris, this tutorial will be for Windows only. I don’t have a Mac (I’m saving for one) and my Linux install is a work in progress (I’m still not confident using it but I’m working on it). As for Solaris….well, I choose to work on the theory that if you’re running Solaris at home, chances are you’re already way beyond my area of expertise and I have no idea why you’re reading this post, or indeed this blog. In fact, if you are reading this and you want to write something seriously techy hard core for the Solaris crowd, we should talk.

Step 1 – Downloading XAMPP

The latest version of XAMPP can always be downloaded from the Apache Friends XAMPP site. The most recent version is v1.65 (although this tutorial uses version 1.63a). (Please note that v1.65 has some compatibility problems with Perl, which could be an issue further down the track. Previous versions of XAMPP can be downloaded from Sourceforge) On this page you will find the version for your platform. The Windows version has three downloads – an installer file version, a zipped package version “for the purists” and a self-extracting zipped archive. The simplest option is the Windows installer. Go ahead and download the installer version. I don’t mind waiting.

Step 2 – Installation

Installation really is easy. Double click on the exe file you downloaded. If you’re running Vista, the following warning message may pop up:

xampp_vista_warning

Just follow the advice and you will be fine. Click “OK” to continue.

The usual installer welcome screen is next. Click “Next” to continue.

xampp_setup_wizard_1

XAMPP will ask you to choose a destination. Vista users should keep in mind the earlier warning message and make sure that XAMPP installs in to your main system folder. I have chosen to install XAMPP directly into my C:\ drive at c:\xampp. Once you have selected a location, click “Next” to continue.

xampp_setup_wizard_2_install_loc

You need to install the web server and database services for XAMPP to be useful for local blog development. At the next screen of the installation, ensure that the boxes are checked for Apache service (the web server) and MySQL service (the database).

xampp_setup_wizard_3_services

The Filezilla option is for the installation of an FTP service. You are probably already familiar with FTP (File Transfer Protocol) but it is not required for our purposes here. I have left that option unchecked.

The shortcuts are also useful but not necessary. I have chosen to let XAMPP install the shortcuts.

Click “Install” to let the XAMPP installer do its thing, which will look something like this:

xampp_setup_wizard_4_install_progress

You might get an error message like the following once the installation is finished:

xampp_setup_wizard_ports_ERROR

I am going to admit that I have no idea why this error message appeared. I waved the rubber chicken and clicked “OK”. Since then, everything seems to have worked just fine. My advice: go with the flow on this one.

Step 3 – Check your installation

XAMPP sets up a local web server on your computer that is accessed by typing http://localhost/ into your web browser. Do this now to see if XAMPP installed correctly with the required services running. If you’re lucky, your browser looks like this:

xampp_install_success

For some reason, one or more of the required services might not be running (for example, the Apache service might not be running because the ports were already in use). You can see which services are running in the XAMPP Control Panel. If you chose to have shortcuts installed, you will find a shortcut to the Control Panel conveniently placed on your desktop. If not, you will also find the program sitting in the main XAMPP folder (the file is called xampp_control.exe).

The control panel looks like this:

xampp_control_panel

The most important services are Apache and MySQL. If they’re not running, you can start them in the Control Panel. Once your control panel looks like the one above, try localhost again.

Hooray!

XAMPP is now installed and ready for business. In the coming weeks I will show you how to install a number of blogging engines on your local machine such as WordPress and Movable Type.

If you are still having problems getting XAMPP up and running, drop me a line in the comments and I will try and help you get it working.

This entry was posted in how-to, tutorials and tagged . Bookmark the permalink.

63 Responses to Local Development: Installing XAMPP

  1. Lucy says:

    Thanks – worked a treat. Now on to the WordPress local install …

  2. shane says:

    Lucy,

    I’m glad it worked. The WordPress local install should work pretty smoothly, too. However, if you want tips on editing themes, you’re on your own :)

  3. cooper says:

    I had this installed on xp and it was great, but still fail to get it to work on Vista no matter where it is installed. Bummer really I did play with all my blog themes that way.

  4. shane says:

    Cooper,

    What exactly is it that doesn’t work? I’ve installed this at least 5 times on Vista and had no troubles at all. If you’ve got any details, I’d love to try and help you troubleshoot it. As you say, it’s an excellent way to play with blog themes without breaking anything important.

  5. Donatus says:

    About the error “Ports 80 already in use… Installing failed”: before installing close all firewalls, and instant messaging programs. This is suggested in another tutorial I found: http://lifehacker.com/software/feature/how-to-set-up-a-personal-home-web-server-124212.php
    I gues that would help someone.

  6. shane says:

    Donatus,

    You’re probably right and that should have occurred to me sooner. It’s interesting to note that everything worked anyway, despite the fact that Apache “failed”.

    When playing around with servers and the like, it’s always a good idea to turn off firewalls before installation. I just don’t remember if I followed my own advice at the time or not.

  7. Morgan says:

    Hello,

    I have tried installing XAMPP on Windows Vista Premium and as I went through the same messages pop-ups as you shown. In my case the port 80 unavailabity prevents me from starting Apache. Can you please help?

  8. shane says:

    Hi Morgan,

    The obvious first step is to close down anything that normally would access the internet, for example browsers, firewalls etc and try again.

    Something else I have found interesting is that sometimes, even though the XAMPP control panel won’t let me start the service, if I directed my browser to localhost, it all seemed to work fine anyway. If you haven’t already, give that a go as well and see if it works.

    I’ll have a play with XAMPP and see if there are any workarounds or solutions. If you can let me know how it goes, I’ll see if anything I find can help you.

  9. Dino says:

    hi everyone , I install xamp easily i just don’t understand when i put php script on and everything the users try to register on site and they never get confirmation code on e-mail , my mercurymail server i think is not working or somthing can sombody help me please .

  10. shane says:

    Hi Dino,

    I just want to confirm some details. Are you saying that you have a website that is accessible via the internet and you have used XAMPP as your server, database and PHP stack?

    If that is the case, you’re probably aware that is generally not advisable given the insecure nature of a default XAMPP install.

    I’m not much of an expert on XAMPP being used for externally accessible websites as I only use it to set up local copies of blogs on my laptop for theme hacking etc. However, if you can give some more detail I will see what I can do to help.

  11. Justin says:

    I’m having trouble with the latest XAMPP (1.6.6a) on my computer, which is running Vista x86 Ultimate.

    The installation runs fine and both Apache and mySQL are able to run. In fact, I can even go through the XAMPP pages in the localhost directory and they all appear to work as they should.

    However, when I try to insert my own PHP pages (even a simple test file containing something like “”), it doesn’t run the PHP code (i.e. I’m able to see the source code through the browser, which I shouldn’t be able to). Also, external CSS files fail to be put to use (they need to be embedded to work).

    I have tried both in my own specified folder as well as in the xampp folder as some people suggested, but both result in the same situation.

  12. Justin says:

    Guess I shouldn’t have added the PHP tags to the quote. I wrote ‘echo “hello”;’

    I forgot to mention that I tried some of the other server applications such as EasyPHP and found that PHP still didn’t work.

  13. shane says:

    Justin,

    I haven’t come across that one before. I’ll look into it and report back when I know some more.

  14. Daquan says:

    Hello, I’m having problems with xampp. I have always had this problem and it seems that I can always see the php source code in the browser. Both the mysql and apache services are running in the control panel. I went to look at the local host page and it looks fine but then I go look at some of the php pages and I see the code on the page and can always see it when I open the source code. Basically I can’t do anything with it because php isn’t working right and I can’t get wordpress to function correctly with it either. Please get back to me, preferably e-mail since I’m not familiar with this site but I’ll bookmark just this page incase.

  15. shane says:

    Justin,

    Are you trying to access your own php pages through browser or are you opening them up from your file manager (eg Windows Explorer)?

    I’ve been caught up with work and study this week and haven’t had a chance to update my own installation to 1.6.6a to see if there are any conflicts with the latest version.

  16. Justin says:

    I’ve been trying to open the pages with my browser (both FireFox and Internet Explorer). I guess I over-exaggerated a bit though. It seems an echo “hello”; will work fine.

    The code that I tried to use that didn’t work was $time = time() + microtime(), and further in I had echo round(time() + microtime() – $time, 4);

    I’ve used this code in other pages on my laptop (which is running an older version of Xampp on Windows XP Home) and it works fine there.

    What troubles me more is the fact that even external CSS files (connected through use of the link tag) don’t even seem to work. I feel that perhaps there is some connection between the two issues.

    I believe Daquan is probably experiencing the same problem.

  17. shane says:

    I’m not much of a PHP guru I’m afraid (a better knowledge of PHP is on ‘The List’) so I don’t know if I can help you with the specifics. I’m more of a use pre-existing tools for my own purposes I suppose with hacking/tweaking on the side.

    Having said that, if you’ve got an example of the PHP code and HTML/PHP where you’re trying to link to the CSS available for download somehwere (or you can email it to me at shane@techwhimsy.com) I’m happy to have a look at it when I can and see what I can make of it. I have a gut feeling you’re right in that the two are connected.

    Daquan does seem to have a similar problem although initially it was more due to using File -> Open File instead of File – Open Location to access the locally hosted PHP files.

    I’m sorry I can’t be more use at the moment. It does seem a strange one as for me XAMPP has worked first time, every time.

  18. Justin says:

    I suppose I really should have tried doing what I just did earlier. I moved the files over to my laptop and noticed that, quite surprisingly, the PHP still wasn’t being processed (i.e. it was just getting spit out to the browser). And I know that PHP does work on that laptop (I’ve been building all my web pages with it), so I figured maybe it’s actually something else and the encoding type was the first thing to come to mind.

    I opened the file up with Notepad and did a Save As, and noticed that the encoding was set to Unicode. I think I may have actually run into this problem before some number of years ago, but had completely forgotten about the lack of compatibility with “Unicode” encoding.

    After changing the encoding to UTF-8, the PHP is actually being processed and even the external CSS files are being read, like they should be.

  19. deepthi says:

    Hi,
    I installed the xampp succesfully, and my apache and mysql in the control panel show running and status ok…
    but when i open the http://localhost/ in my explorer i get a 403 forbiddne error. can you please tell me why i am getting this.

    thanks in advance..

  20. shane says:

    Hi deepthi,

    I haven’t come across this problem before. I’ll look into it and report back.

  21. d88w7a9 says:

    i am trying to install this to a dynamic dns site.. it will not let me route this to an external site. i have all security measures secure so it is okay to have this external… help!

  22. shane says:

    I’m not really sure how to fix this one. I’ve never tried to setup up XAMPP for an external site. I’ve only ever used it for development and testing purposes on my own machine.

    I’ll see what I can find out but I don’t know how much help I can be here I’m afraid.

  23. David says:

    I have a control panel even though I got the port 80 or 443 error. When I go to my local host it looks like an FTP screen. IT says “INDEX of/”
    # Thumbs.db
    # apache_pb.gif
    # apache_pb.png
    # apache_pb22.gif
    # apache_pb22.png
    # apache_pb22_ani.gif

    Can you help, please? thanks

  24. shane says:

    Hi David,

    Can you link to a screenshot of what the localhost looks like, or can you email one to me? My email is shane@techwhimsy.com I’m happy to take a look and see if I can fix it.

  25. Stanley says:

    I’ve installed XAMPP 14 ways to Sunday and I still never get access to a control panel. I am running a WIN2000 fully updated. I am using this to install Joomla! on my PC for learning purposes. But I can not figure out why I’m not getting the control panel. http://localhost works fine. Any idea?
    Thanks

  26. shane says:

    Hi Stanley,

    If localhost is working fine (ie you get the XAMPP page as pictured above in Step 3) then you don’t really need to have access to the Control Panel. If localhost works, XAMPP should be up and running and you should be able install Joomla just fine (which, oddly enough, I have a screencast on how to do just that here – http://techwhimsy.com/local-development-how-to-install-joomla-on-your-local-windows-machine).

    I can’t remember the last time I even bothered to open up the Control Panel. I generally just use the start_xampp.exe file to get it all up and running.

  27. newby says:

    After installing xampp on a vista machine it worked well. When I restarted the my computer Apache wouldn’t run any more and always causes blue-screens. What can I do?

  28. shane says:

    This might seem like a stuipd question but did you install Apache separately to XAMPP?

    The only instances I have heard about where Apache causes a blue screens on Vista is the standalone installation of Apache.

    Sometimes things can go screwy in any installation. Uninstalling and re-installing can also work as well.

  29. newby says:

    Hi,
    Thanks for your answer!
    The problem seems to be caused by the way user rights are managed by Windows Vista. Before the installation began, I was adviced not to choose “Program Files” as destination folder.
    This time I didn’t ignore that and everything works fine :-)
    I’m puzzled about Vista’s managament of user rights anyway.

  30. shane says:

    If I understand the changed permissions correctly (and I might not…), Vista has tightened up what programs in the ‘Program Files’ folder can and cannot do. I believe it’s an attempt to stop rogue programs opening up security holes.

    I find having XAMPP in the root C: directory easier to manage anyway – less folders to click through.

    I’m glad it’s worked out for you, and I can add one more thing to my troubleshooting checklist if anyone else has the same problem.

  31. Manikanta says:

    When i installed xampp .it is ok .while checking php pages.it is giving an error that is username &password are not correct.
    who to create a user in xammp

  32. shane says:

    Hi Manikanta,

    That’s an unusual problem as XAMPP shouldn’t ask for a username and password just to view pages written in PHP.

    Did you install XAMPP under a user account on your computer that had administrator priveleges?

  33. Pingback: XAMPP Tutorial

  34. stephen says:

    I have installed XAMPP on Vista and I get no errors when installing initially and the Control Panel shows Appache and MySql running correctly. However, no matter what I do, when I try and go to http://localhost/ all I ever get is ‘Internet Explorer cannot display the webpage’. Any ideas anyone??

  35. Shane Perris says:

    Stephen,

    Have you tried using start_xampp.exe instead of the Control Panel? I have found the control panel to be flaky in the past (it could just be me).

    Using start_xampp.exe should guarantee that all the relevant services are running in the background.

    Let me know if this works for you.

  36. erjon says:

    i have e problem. when i try to open http://www.localhost , it doesn’t open. what can I do??

  37. Shane Perris says:

    Hi erjon,

    Try taking out the www and just using http://localhost Hopefully it should work now.

  38. Pingback: ArKane Scripts » Blog Archive » Designing your first PHP driven website - Part 1

  39. Nana says:

    I was trying to put in a password and it would’t work. i had this error any help.

    Access forbidden!

    You don’t have permission to access the requested object. It is either read-protected or not readable by the server.

    If you think this is a server error, please contact the webmaster.
    Error 403
    localhost
    12/28/08 18:10:11
    Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8

  40. Mel says:

    Hiya,

    Just wanted to let you know that if you cannot access http://localhost (because it asks you for a username and password) and apache doesent appear to run through your control panel. Its probably because you have IIS running as a service. If you disable that, then all should work just fine.

    Access services through (XP) :
    Control Panel > Administrative Tools > Services

    Look for: “IIS Admin” in the list

    Right click on it and “stop” the service.

    Try going back to your broswer and entering in http://localhost
    You should now be able to access everything.

    Thanks Mel

  41. Piet says:

    Unfortunately the above tip doesn’t work for me :(
    For the past 24hrs I have tried to make it work but I fail each time on the last step: http://localhost/xampp/wordpress/wp-admin/install.php
    I then receive the error Access Forbidden

    Any other tips?
    Windows XP Pro SP 3
    XAMPP 1.7.0
    Trying to install WordPress 2.7.1

    Any suggestions welcome!

    Piet

  42. Matt says:

    @Piet

    The tutorial might be a little outdated. I had to create a user ID and allowed XAMPP to create a database in order to get this to work. Prior to that I was beating my head against the wall…….

  43. VAMSI says:

    Hi,

    I do have installed Xampp on my Windows Vista 64 bit OS, I do disabled the UAC before installing. I have installed Xampp at C:/Xampp. Every thing is working fine Apache running, Mysql running, PHPinfo page is showing properly. But when I open the index.php file from the browser it says ” Some Thing is Wrong with your Xampp Installation :-)”. Can any one please troubleshoot this, I tried to install several times.

  44. Lizard578 says:

    ok silly question time
    got xampp installed fine even get to localhost fine
    can run php scripts fine
    what concerns me is that i don’t have to have xampp running to do these things
    so the silly question is …
    should i be able to get to local host when xampp is NOT running?

  45. Lizard578 says:

    sorry ignore the above post

    got to say ….
    i would like to think if you click exit in the xampp control panel it would have shut down the apache and mysql server so that they are not running but apparently no

    certainly taught me to stop apache and mysql then exit out of the control panel
    and if browser is open when running these 2 services then restart browser otherwise it still can use apache and mysql

  46. Tim O'Brien says:

    Hi are having problems with the error on installing Apache 2.2 MySQL is running but Apache refuses to run have stop everything that might use same ports and allowed permissions through fire wall but nothing seems to work. If you could help me find a solution it would be appreciated. Eventually wanting to install WordPress locally.

    Am running Windows XP with Service Pack 3

  47. Jakob says:

    hey, i cant run Apache in XAMPP. nothing happens when i try to activate it

    hope you can help me pls.. ;)

  48. Hendy says:

    hi… I am a beginner, and this is my first time to learn all of this. I don’t know what I’m wrong.. I have installed xampp the latest version 1.7.2, then I try to open http://localhost/ and it keeps loading.. It just shows blank page. And I have other question, when the installation successful, where should I put my web files to? I have .php file and it cannot be open.. it just asking open or save like download file from the web.. please help me.. thank you..

  49. Hendy says:

    hi.. just ignore about the localhost, it works now when I click admin in control panel. Everyting is running fine. But, the .php files still cannot be opened, whats wrong with that? Do I need to locate the .php files inside the c:/xampp/ directory or it doesn’t matter the files are located as long as the xampp is running correctly?
    Thank you.

Leave a Reply

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