XAMPP is a package what will install Apache (a Web server), PHP (a programming language), MySQL (a database package) and other stuff on your PC. This makes it easier to do exercises. You can test everything on your own machine first, and then upload the finished files to your production Web server.
Why XAMPP is useful
XAMPP helps when you need to write a program that runs on a Web server.
Let's look at a case where you don't need to use XAMPP. Suppose you have a plain HTML file on your C: drive. You can tell a browser to open the file directly from your C: drive. Use File | Open in the browser menu. This is what is happening:
![]()
This works just fine, since the browser knows how to interpret HTML.
However, browsers do not know now to interpret PHP. Suppose you have a file on your disk drive with a mix of HTML and PHP in it, and open it directly in a browser:
![]()
The browser will just show the PHP as normal text, or will fail in some other way.
To try it, use a sample file that outputs a lie a number of times. Right-click here, and save the file somewhere on your C: drive, maybe in My Documents. Then try opening the file in your browser. Your browser can't make sense of it, because it can't run PHP.
If you want to run a PHP program, your can't just open it off your disk drive. You need to open it from a Web server, like this:

The Web server (or, more accurately, a support program) knows how to run PHP. So the server will grab its copy of the HTML/PHP file, and run the PHP. Then it will send the result to the browser. The result will not contain any PHP (it has all been run), so the browser will not get confused. Let's take the sample HTML/PHP file mentioned above. Try left clicking here to run the sample file on the server in the normal way.
OK, so, suppose you're working on a PHP project. You create a file called billy.php that has PHP in it. You need to get it to a Web server, so the server can run it. Which server do you use?
The most obvious choice is to upload the file to your server account. Suppose you have the file bluebellybats.com. So you write billy.php (in Aptana or some other editor), upload billy.php to bluebellybats.com (using WinSCP), and try it at http://bluebellybats.com/proj1/billy.php (or whatever) in Firefox. No problem.

Notice that there are two copies of your file billy.php. One on your PC (that you're editing with Aptana), and one on the server (that Firefox is actually showing).
What happens when the two copies get out of synch? Suppose you find an error in billy.php. So you edit billy.php, upload it again, and refresh your browser. Still not right. So you edit billy.php again, upload it, and refresh. Still not right. You edit billy.php again (getting it right this time, though you don't know it yet), and refresh your browser. Still not right.
WTF? billy.php is actually right, but doesn't look it. Why not? Because you forgot to upload the latest version to your server.

You think you see the latest version of billy.php in your browser, but you're seeing an old one. You check for errors, can't find any, waste a lot of time until you ask yourself, "Self, did I upload the new file?" Dooooh!
There are various solutions to this problem. One is to use XAMPP. It will install a Web server on your local computer. This lets you skip the upload step. You can work directly on the file the Web server is seeing.

You don't need to remember to upload things. There is ever only one copy of billy.php. The one you edit and the one you see in the browser are the same file. You don't even need a connection to the Internet to get everything to work.
Suppose you install XAMPP in c:\xampp (which is what I recommend). Your file will be in c:\xampp\htdocs\proj1\billy.php. This is the file that will map to the URL http://localhost/proj1/billy.php. You can also open the file directly in Aptana, and edit it. Exactly the same file.
Eventually, you get all the files in the project working. billy.php, xander.html, tara.php, rupert.php, willow.css, and the dozen other files you need for the project. Then you upload them all in one step. The entire project should work on your real server, because you tested it on the XAMPP server.
Many people - me included - find this an easier way to work. Set up XAMPP once, and you can build all of your applications locally before deploying them on your production server.
Other reasons to use XAMPP
If you use XAMPP, you'll have a better understanding of (1) how the Web works, and (2) how real companies deploy Web sites. All but the smallest companies use development and test servers. Programmers make sure things work first, then they make them available to users. Typically, a development server is inside the company's intranet. Programmers and testers work on it there. Then at some point, maybe 3 a.m. one Sunday, the new files are copied to the production server.
How to install XAMPP
Download XAMPP. Get the full version, not the lite version. Run the installation program. When it asks you where to install XAMPP, use C:\xampp. Do not install it in C:\Program Files.
When XAMPP is installed, you will see a XAMPP program group in your Windows start menu. Start the XAMPP control panel. Start Apache (and MySQL if you want). You should now have a Web server running on your computer.
Start a Web browser. Firefox is the preferred browser for this course. Point it to http:\\localhost. You should see the XAMPP start page.
Creating a new Web site with XAMPP is very easy. Just create a directory under c:\xampp\htdocs. For example, suppose you wanted to create a Web site about llamas. Create the directory c:\xampp\htdocs\llamas. That's it! Point your browser at http://localhost/llamas. Any files you put in c:\xampp\htdocs\llamas will show up in your browser.
If you want to test it, find a picture of a llama on the Web. Suppose the file was named llama2.jpg. Save it to c:\xampp\htdocs\llamas (right-click on an image in your browser to save it). Go to your browser, and type in http://localhost/llamas/llama2.jpg. The picture should show up.
Security
OK, so you're running a Web server on your own computer. Does this mean that anyone in the world can access your PC as a Web server? The answer is usually "no." XAMPP configures Apache to allow requests from anywhere. So why is the answer "no?"
Network requests contain IP address (e.g., 123.123.123.123) and ports (e.g., 123) of the source and destination. To access your XAMPP server, someone would need to be able to send HTTP requests to your computer (i.e., at your IP address) to port 80 (the default HTTP port).
You should be running a firewall on your computer, on your router, or both. A firewall is software that examines incoming and outgoing network requests, and decides whether to allow them through. The firewall should be configured to disallow incoming requests to port 80 of your computer. That is the normal default for firewalls (AFAIK), but you can check your own software.
If you want, you can secure XAMPP even more, by configuring Apache to only allow requests from your own computer. Here's some text from this article:
By default, the Apache server is visible to anyone in the network (KRM NOTE: this means the LAN inside your house). To avoid this and make the Apache only visible to the local machine, we need to modify the [xampp]/apache/conf/httpd.conf file as below:
<Directory "c:/xampp/htdocs">
...
Allow from all
<Directory>to
<Directory "c:/xampp/htdocs">
...
Allow from 127.0.0.1
<Directory>After this change, search for the string Listen 80 in the httpd.conf file and change the string to Listen 127.0.0.1:80. This will ensure that Apache is only available for the local machine.
Also, it is recommended to change the MySQL server’s root user password, because by default MySQL server installed with no password for the root user.
If anyone has any other advice, please post it on the forum.