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. Hendy says:

    hi.. I got it now, it should be locate inside the c:/xampp/htdocs/. But how to connect the database from php?
    It shows like this
    “Warning: mysql_query() [function.mysql-query]: Access denied for user ‘ODBC’@’localhost’ (using password: NO) in C:\xampp\htdocs\public html\main_left.php on line 3”.
    how to fix it? please help…. thank you

  2. Hendy says:

    And now, another problem appear..
    when I try to open the database, it show like this:
    #1045 – Access denied for user ‘root’@’localhost’ (using password: NO)
    phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
    What should I do? Please……………………. helpppppppppppppppp!!!

  3. Shane Perris says:

    Hi Hendy,

    I’m going to need a little more information, and I can’t promise I’ll be able to help you find the answer either.
    – what is the PHP file supposed to do?
    – did you set up a password at all during the installation process or with MySQL? You might need to uninstall and then reinstall XAMPP to make sure
    – why do you need a MySQL database? Is this related to the PHP file?

    Thanks

    Shane

  4. wilson says:

    I had problem when i installed XAMPP . when I try to server apache at local host: http://localhost then it automatic go to http://localhost/XAMPP/index.php, I can’t get default localhost page . It come out failure connected. Therefore, I can’t located to test my file.php. My system is window vista home basic. Please help help!!!. I ‘m ready read some problem same mine, but can’t figure out.( I already reset security for username, pw in XMPP1.7.2, and also run XAMPP control panel but doesn’t work.)

    Thanks a lot for help

    Wilson

  5. Earnest says:

    i am getting an error when i try to install xampp with vista. it is saying tar is not as a command, program or batch file. What am i doing wrong. i am placing this at my command prompt
    tar xvfz xampp-linux-1.7.2.tar.gz -C /opt

  6. azerky says:

    i can’t use my php csript in xampp 1.7.2, but its work fine in xampp 1.6.3a..
    what sould i do??help…

  7. Moinul Islam says:

    hi,
    I’ve install xampp in my c drive. I also work on Java using MySql database server as back end.
    First I installed Java and Mysql. I set a password for my MySql database. Next I install xampp ingnoring mysql installation . But I cannot connect PHP with MySql server. When I click phpmyadmin link it generates error. Please help me to solve this problem

  8. ajay bakshi says:

    i have xampp already installed in my machine under d drive.
    i install xamp add on, but due to this it is asking for user name and password on localhost . wat i do?

  9. Neha Oza says:

    Hi,

    I have successfully installed XAMPP on Windows Vista but i got entirly different installation option. First i has asked me for location where do i want to install so i selected C drive and then it has shown me dos window asking me whether i need shortcuts on control panel or desktop i chose Y and it started relocating for mysql, php etc.

    But good part is at the end of all i got XAMPP control panel shown here so i got that i have successfully installed XAMPP.

    I could not get why i got different windows for installation???

    If you can explain me?

  10. Shane Perris says:

    The post is a couple of years old now. They’ve probably made some changes to the install process. I should think about updating it at some point.

  11. zubair says:

    I read your article for installing xamp and i installed successfully but when i want to connect to phpMyAdmin i get the following error please help me urgently

    Error
    MySQL said:

    #1045 – Access denied for user ‘root’@’localhost’ (using password: NO)
    Connection for controluser as defined in your configuration failed.
    phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

  12. Debra says:

    Hello, the ‘admin’ option on my XAMPP Control Panel recently stopped working.

    No error messages, but nothing happens when I click on ADMIN. It used to work fine. Any ideas?

    Thanks.

  13. ken loke says:

    why it says Restricted access?

Leave a Reply

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