Setting up XAMPP on Windows

XAMPP, Part 1

The first WAMP stack I’m reviewing is XAMPP. Because it is a popular package, I thought there should be  a lot of information already available about it, and the obvious first place to look is the ApacheFriends website. While their offerings are available in several other languages, I’m going to stick to English for this series. 😉  I found out, however, that the information can be a bit sparse, so I Googled it and found a few other (somewhat) helpful pages.  I think you’ll find this one both up-to-date and generally more useful (IMHO).

I have been using XAMPP for Windows for about five years and it has proven to be an effective and well-maintained package. It’s an easy package to install and can also be set up as a portable environment, like on a USB memory stick. It has several included subsystems that help make it a good package to perform tests.

What’s in the main package?

  • Apache The Web server, which is the heart of why we’re doing this
  • MySQL The Database server, where most applications will store their data.
  • PHP + PEAR Scripting language and library, respectively.
  • Perl Scripting language (an alternate)
  • OpenSSL Secure Sockets Layer (for handling https: connections)
  • phpMyAdmin MySQL administration program
  • Webalizer Apache log analysis program
  • Mercury Mail Transport System for Win32
  • Ming Graphics handler
  • JpGraph Graphics handler in Java
  • FileZilla FTP Server
  • eAccelerator
  • SQLite Alternate Database server, very simple and fast.
  • WEB-DAV Allows connection to Windows files
  • XAMPP Control Panel

There also is an add-on for Tomcat that enables JavaServer Pages and Java Servlets, which are the web presentation layer in the Java 2 Platform, Enterprise Edition Platform.

The packages are available through ApacheFriends.org’s XAMPP for Windows. I used to download the .zip files, but the .exe package has the same contents in a self-extracting package; it’s also smaller to store and less to download (by almost half).

So let’s start with what’s necessary to know BEFORE you start.
Where are you going to put this package? I strongly suggest that you put it in the root directory of the target drive (C:\ or E:\, for example). I installed mine in C:\, and the examples will all show this location.  The Readme file has these notes:

  • If you want to use Mercury, you must install XAMPP in a short path which follows the old DOS 8.3 naming conventions.
  • If you want to use the Perl cpan/cpanp shell, the path to XAMPP must not contain a space.

Will you want to access the server from other computers, like on a LAN?  Is it a private or home network? Do you need to open it up for Internet access (which can be a serious security hole)?  I’ll discuss this in a separate article later.

Will you want to set up an email service, so you can test your application’s emailing functions?  Do you need this to connect to an external mail service as well?

Are you using Windows 7 or Vista? If so, User Account Control will be very evident, especially if you choose to install in C:\Program Files (don’t do that; it’s not recommended. Why create more problems for yourself?).

Let’s see what the actual installation looks like.  That may help you make some of these choices.  I’ll assume you’ve been able to download the current XAMPP for Windows .exe file, which currently is xampp-win32-1.7.3.exe.
When you execute this, the first screen for the install is:

This is where you choose the disc drive where you want XAMPP to reside. If you can’t put it in the root directory of the disc, avoid directory names with spaces.  Note: the xampp directory will be created by the install; no need to repeat it or you’ll get something like c:\xampp\xampp.

The installation program automatically initiates a setup script.  By the way, you can click on the image to see it full size, and use your browser’s “back” button to return here.

Here’s your first choice, based on what type of installation you are doing. If your installing on a permanent drive, you want to have these shortcuts to make life a bit easier. If you have installed this on a USB memory stick to create a portable installation, you do not want to create shortcuts.


The second question asks whether you want the paths to be properly updated at this time. As delivered, all the paths are set to a bogus location, and need to be updated to match the location that you selected for installation.


This third question applies to whether or not this will be a portable server or not. If you put it on a USB drive, choose “y” so the paths will be properly created. I realize that the NOTE is more confusing than it should be. The bottom line is portable = y, permanent = n.


So now we have XAMPP’s paths all adjusted properly and the system is ready–almost. There’s one more minor item to resolve.

Hopefully the time zone guess was right. Just for now, don’t worry if it’s wrong; this is not a disaster. Later on you will want to edit the php.ini file to fix it, and we’ll cover that soon. The good news is that XAMPP is really ready now.

The next screen is the “setup” menu, which you can restart (if you need to) from the XAMPP Control Panel later.

From this menu, we’ll select option 1, which will start the XAMPP Control Panel. This is what you’ll see:

Let’s first hit the Port-Check button, so we can find out if anything is running that will interfere with our servers. If anything shows up under Status for ports 80, 443, and 3306, we’re going to have a problem starting our new servers.  Obviously, if you have been experimenting with other Web server systems, such as IIS, you’re likely to have these problems. For example, if it says:

Apache <HTTP>       80      C:\WINDOWS\system32\inetsrv\inetinfo.exe

then you have IIS running.  Go to the Windows Add or Remove Programs and on the left you’ll see Add/Remove Windows Components.  In that you’ll find the Internet Information Service (IIS) entry.  Just unclick it and hit Next to apply the changes.

Be sure to check on any other programs you’ve previously installed or activated.

Assuming that the port-check now shows all ports are free, we can start Apache, and after it shows “running”, start MySQL.

Ooops! If you have a firewall running, it just caught your Apache server attempting to listen for requests.  The same thing will show up for MySQL as well, since it uses a port to communicate.

Click the Admin button on the Apache line in the XAMPP Control Panel.  This will start your default web browser and point it at http://localhost/xampp, which will show the XAMPP for Windows admin page.

The initial splash screen is :

Since XAMPP doesn’t yet know what language you want to use, It asks you to select it; I’m going for English to keep things consistent. The next screen is the the Admin Welcome page.

I suggest you spend some time with this and the associated pages.

In my next article, we’ll look at some of the links and what they can do for you.

One thought on “Setting up XAMPP on Windows

  1. XAMPP includes a sample SQLite application, the phonebook. After you install XAMPP, check out the phonebook demo. All the code is in xampp\htdocs\xampp in file phonebook.php. In this case, the first few lines of PHP code (about line 35 in the file) designate where the actual DB is located. Since there’s no SQLite “server,” there’s also no special location required for the databases.

    I suggest you go to http://www.sqlite.org for more information on SQLite and specifically on creating a new database.
    Hope that helps.
    Bob

Leave a Reply