XAMPP is a package created by Apache Friends (http://www.apachefriends.org), which includes Apache, PHP, MySQL, and many other goodies. If you don't have these already installed on your machine, the easiest way to have them running is to install XAMPP. XAMPP ships in Linux, Windows, Mac OS X, and Solaris versions.
Tip
Our web-hosting friends at http://nexcess.net are offering special discount prices for the readers of this book. Their servers are also configured to run the examples in this book.
Follow the steps of the exercise in the next section to install XAMPP on your Windows machine. The installation instructions for Linux are presented afterward, in a separate exercise. Mac OS X users can find their version of the software, together with installation instructions, at http://www.apachefriends.org/en/xampp-macosx.html.
For more information about installing XAMPP, you can check out its Installation wiki page at http://www.installationwiki.org/XAMPP.
Here are the steps that you should follow:
Visit http://www.apachefriends.org/en/xampp-windows.html, and download the XAMPP Lite installer package, which should be an executable file named something like
xampplite-win32-version-installer.exe
.Windows Vista users should take note of the Vista note on the page, which reads:
Because of missing or insufficient write permissions in C:\Program Files, we recommend to use alternate folder for XAMPP (C:\xampp or C:\meinverzeichnis\xampp).
Execute the installer executable. We recommend that you install XAMPP in the root folder of your drive (this will create a folder named
C:\xampplite
). In most cases, it's safe to use the default options throughout the setup process.After the setup finishes, start the XAMPP Control Panel and configure Apache and MySQL to start Apache and MySQL as services (by selecting the checkboxes), then start the services (by pressing the Start buttons), as shown in the following screenshot:
Tip
You can't have more than one web server working on port 80 (the default port used for HTTP communication). If you already have a web server on your machine, such as IIS, you should make it use another port, uninstall it, or deactivate it, otherwise, Apache won't work. To make Apache work on another port, you should edit
C:\xampp\apache\conf\httpd.conf
, locate lines containing Listen 80 and ServerName localhost:80, and replace the value80
with the port number of your choice (8080
is a typical choice for a second web server).To test that Apache installed correctly, load
http://localhost/
(orhttp://localhost:8080/
if Apache works on port 8080) using your web browser. An XAMPP welcome screen, like the one in the following screenshot, should load:To test the phpMyAdmin installation, load
http://localhost/phpmyadmin/
. The page should look like the following screenshot:
Tip
For more details on installing and using phpMyAdmin, see its documentation at http://www.phpmyadmin.net/home_page/docs.php. Packt Publishing has a separate book for those of you who want to learn more about phpMyAdmin—Mastering phpMyAdmin for Effective MySQL Management (ISBN: 1-904811-03-5). In case you're not a native English speaker, it's good to know that the book is also available in Czech, German, French, and Italian.
Here are the steps you should follow:
Visit http://www.apachefriends.org/en/xampp-linux.html, and download the XAMPP package, which should be an archive file named something like
xampp-linux-X.Y.Z.tar.gz
.Execute the following command from a Linux shell logged as the system administrator root:
tar xvfz xampp-linux-X.Y.Z.tar.gz -C /opt
This will extract the downloaded archive file to
/opt
.Tip
You can't have more web servers working on port 80 (the default port used for HTTP communication). If you already have a web server on your machine, you should make it use another port, uninstall it, or deactivate it. Otherwise, Apache won't work. To make Apache work on another port, you should edit
/opt/lampp/etc/httpd.conf
, locate the lines containing Listen 80 and ServerName localhost:80, and replace the value80
with the port number of your choice (usually the8080
is used).To start XAMPP, simply call the following command:
/opt/lampp/lampp start
To restart XAMPP, replace
start
in the previous command withrestart
, and to stop XAMPP, replace it withstop
.To test that Apache installed correctly, load
http://localhost/
(orhttp://localhost:8080/
if Apache works on port 8080) using your web browser. An XAMPP welcome screen, like the one in the previous screenshot, should load.