Feb
8
Local Development: Installing XAMPP
Filed Under how-to
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:
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 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.
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).
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:
You might get an error message like the following once the installation is finished:
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:
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:
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.
If you're new here, thanks for stopping by. If you like what you read, you may want to subscribe to my RSS feed. Thanks for visiting!
Like this post? Please consider submitting it to one of the following services:
Spread the Word!
Comments
33 Responses to “Local Development: Installing XAMPP”
Leave a Reply



Thanks - worked a treat. Now on to the WordPress local install …
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 :)
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.
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.
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.
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.
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?
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.
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 .
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.
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.
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.
Justin,
I haven’t come across that one before. I’ll look into it and report back when I know some more.
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.
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.
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.
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.
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.
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..
Hi deepthi,
I haven’t come across this problem before. I’ll look into it and report back.
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!
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.
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
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.
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
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.
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?
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.
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.
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.
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
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?
[...] TechWhimsy, Local Development: Installing XAMPP. [...]