How to set-up a PHP enabled web server on your local computer with XAMPP
Installing the Apache web server with PHP on a local computer: localhost.
See PHP: Intro for tutorials on how to utilize PHP in website design.
The XAMPP package.
Individually installing and configuring the Apache web server to work with PHPPHP: Hypertext Preprocessor and a MySQL database is not an easy task. There is a better way.
XAMPPCross-platform Apache MySQL PHP Pearl is a free open source package that will handle the configuration for you.
Downloading and installing XAMPP.
XAMPP can be downloaded from
ApacheFriends.org XAMPP.
I chose 'XAMPP for Windows'
ApacheFriends.org XAMPP for Windows because that is the operating system I am running (Windows XP) and then decided 'XAMPP Lite' (current version 1.7.1) would be sufficient for all my requirements and downloaded the 'ZIP Archive' file to my C Drive.
With the file downloaded I unzipped it and then moved the whole of the contents: a folder called 'xampplite' to the root of my C Drive.
What's great about the installation procedure in that you do not need to invoke the Windows Installer, that makes removal easier as the installation does not write to the registry.
So open the 'xampplite' folder and inside you will find among others the following files.

Run the 'setup_xampp.bat' file by double clicking it. You should see the Command Prompt window open and when you have the success message 'Press any key to continue...' as the instruction in the window states.

Now run the 'xampp-control.exe' file by double clicking it. You should see the following the 'XAMPP Control Panel Application' window. This is where you start and stop the Apache web server.

Start Apache now by clicking on the 'Start' button alongside Apache.

The Apache web server is now running and you can close the 'XAMPP Control Panel Application' window. An XAMPP icon should be visible in your task tray on the bottom right of your screen. Clicking on this icon will bring the Control Panel back into view.
If you wish to stop Apache use the Control Panel.
You're nearly done.
Now open your favourite browser and enter the following address:
http://localhost/xampp/splash.php
The equivalent using the IP address to replace the domain 'localhost' would be:
http://127.0.0.1/xampp/splash.php
The XAMPP splash screen will appear and all you need to do is choose your language.
For me: English.
Depending on the language you chose the following or similar window will appear.
The address is: http://localhost/xampp/index.php
This window is your portal to a range of XAMPP demos and tools.

That's it as far as setting up the Apache web server just to view PHP web pages. If you are not intending to set-up a MySQL database or use any of the other XAMPP tools you can now close the XAMPP window.
Viewing your PHP web pages.
You now can test your own PHP files in a safe environment where you can experiment all you like without anyone witnessing your mistakes.
If you still have the 'xampplite' folder open place any web page you wish to test in the 'htdocs' folder which is a sub folder of the 'xampplite' folder.

To view any web pages inside the 'htdocs' folder simply enter the required address into your browser.
For example if you have created a page called 'test.php' and placed it directly inside the 'htdocs' folder then the address to enter in the browser is:
http://localhost/test.php
If you decided to place your file 'test.php' inside another folder such as 'mysite' then the address would be:
http://localhost/mysite/test.php
That's it. Have fun.
Article by: David Beet.
Date: 10th April 2009.
Video tutorial.
For those of you who prefer to watch a video tutorial try this from YouTube:
Further PHP and Open Source resources:
Please note that justfigures is not responsible for the content of external internet sites.
- http://filezilla-project.org/ - FileZilla The free FTP solution
- http://www.php.net/ - home of PHP
- http://uk2.php.net/manual/en/index.php - PHP manual
- http://www.opensource.org/ - Open Source Initiative
- http://www.apache.org/ - home of the Apache web server
- http://www.mysql.com/ - home of MySQL
Back to top.
Copyright © 2006-2010 justfigures.co.uk
