Installing XAMPP on Windows

XAMPP is a free software for developing Dynamic Web Applications offline. It is available for multiple platforms (Mac, Windows and Linux). Here I will be focusing on installing XAMPP for windows. If you are a Mac user the installation process may differ but the usage is quite the same.

Downloading and Installing XAMPP

Download the xampp.exe software from the XAMPP site and double click on the .exe file to begin the installation. Once the installation has started you will see an image as shown. It lets you select the various tools that you want to install in your system. By default all the applications will be selected.

Xampp Installation Screen
Xampp Installation Screen

Then select the drive location in your system where you want the XAMPP software to be installed. Click install and wait for the installation to complete

Starting XAMPP

After finishing the installation open the XAMPP application and start the apache web server. Once you click on start button, the apache text under the module section will be displayed with a green background which is a sign that the server is running. You can start the MySQL server if you want to check on the phpMyAdmin (A utility used for users who prefer GUI for MySQL). Thanks to the phpMyAdmin team, it makes our work easier to people who don’t prefer command line MySQL.

Xampp Control Panel
XAMPP Control Panel

After starting the apache server in the XAMPP program, open any of your web browser (Firefox is preferred) and in the URL type localhost. You should see the XAMPP start screen asking you to select the language. If you don’t see the XAMPP start screen then it is probably because the server is not running. Check if the apache web server is running in the XAMPP control panel, which will be in the notifications area if you have minimized it.

Making sure that the Apache server is running, it is time to test the PHP script engine. Open a new document in any of your text editor.


Code :

// display the list of modules installed with php
phpinfo();
echo 'hello world!';

Type the above code and save the file as index.php (or any name you require, and be sure to use the .php extension). Make sure you select all files option while saving with notepad in windows so that you don’t save it as a .txt file. Save the file in the XAMPP installation directory, inside the htdocs folder with a new folder which represents your web site (by default the directory is c:/XAMPP/htdocs/YourFolder/index.php). Now open your browser and type localhost/folderName/index.php and you will see the page displaying the list of libraries the current PHP installation is compiled with.

Xampp phpinfo test Page
Installed PHP Modules Info

In the XAMPP control panel click on the config button. A window will appear showing you the options to choose the modules that should start automatically when XAMPP application is started. Most common modules to turn on is the apache module, which is the web server and the MySQL database.