How to install xampp for Windows with setup for PHP development

To work on PHP development in your local computer you need to install XAMPP or WAMP. XAMPP full form is cross platform (X) Apache (A) MySQL (M) PHP (P) and Perl (P). XAMPP provides Apache web server, MySQL server and PHP. WAMP also provides the same except Perl, but it works on Windows only. XAMPP works on Windows and Linux. I will be showing how you can download and install XAMPP for windows in this topic.

mysql serverIntroduction

XAMPP - Cross Platform Apache MySQL PHP and Perl. It provides all components required for PHP development along with Perl scripts. It is an open-source cross platform webserver, you can download for free. This works in Windows and Linux.

WAMP - Windows Apache MySQL PHP. This is also free and works on Windows only.

We will use XAMPP for Windows in our discussion going forward. Unless you already have WAMP installed on your computer, I will recommend installing XAMPP, so that it will be easier to explain, as in our example we will use XAMPP.

PHP program runs on the server, also it can interact with database. So, you can view, insert, modify data or delete data from database using PHP code. In this case your local computer works as the local web server called localhost.

You can read How to write PHP code with examples for beginners to start writing php code if you already have installed XAMPP.

I will discuss installation of XAMPP here, please follow below steps to install it.

xampp control panelInstalltion Steps

Step 1 - Download XAMPP for windows
Step 2 - Install XAMPP for Windows
Step 3 - Verify if XAMPP installed correctly
That's it! If above 3 steps are successful, your are ready to develop and run a php program using your local machine as localhost server.

Watch YouTube Video

Step 1 - Download XAMPP for Windows

You can search in google using 'download xampp for windows' and download it in your computer. Download the latest version. You can download from also.

Step 2 - Install XAMPP for Windows

Once download is complete, go to the folder where you have saved the downloaded file in your computer. Usually it is in Downloads folder, unless you have saved it in other folder. There will be a .exe file for XAMPP. Double click on the exe file. Click on Next button and select the folder if you want to install other than default folder C:\xampp. Keep on clicking on Next Button until it starts installing. Let the installation complete, note that, at the end, it gives successfully installed message. After installation is done, XAMPP control panel should be opened.

xampp install

If it is not already started click on start button as in above screenshot to start Apache web server and MySQL database server. These two services should run to make your computer work as localhost server and enable you to run php program using MySQL database.

xampp server

After the services started, you can see the Apache and MySQL services showing as green in XAMPP control panel. If you are able to do all above steps successfully without error, your XAMPP installion is complete. Now we need to do some verification to see if your localhost server and MySQL database are working fine.

Step 3 - Verify if XAMPP installed correctly

Check Windows Folder

In windows explorer, go to the folder where you have installed xampp. You should see there is a 'xampp' folder created and within xampp folder several other folders should exist, among them there will be 'htdocs' folder, this is the home directory of the xampp server. For me, I installed in D:\xampp. So I can see the folder D:\xampp\htdocs.

xampp php

Check XAMPP Control Panel

XAMPP control panel is the tool available to start and stop xampp server. To run PHP in the web, Apache Web server and MySQL database server should be running. You can start and stop these services using XAMPP control panel. Make sure these two services are running, they should be in light green background color. You will see an icon as apache server in Windox taskbar. If it is not there, type 'xampp control panel' in windows search. Start Xampp control and it should show a screen like below:

download xampp

Now, just to make sure they are working properly, click on the Stop buttons one after the other for Apache and MySQL. Services should stop. Now click on Start buttons and they should start successfully.

If above test works fine then open the browser and type in the url bar as 'localhost', if you see below screen then XAMPP server is working fine.

install xampp for windows

Verify MySQL database

You must check if the database is working correctly. Again in the welcome page above, click on phpMyAdmin from top menu as shown below:

download and install xampp for windows

After clicking on phpMyAdmin, you should see phpMyAdmin screen. This is the admin panel using which you can perform various MySQL database activities along with running SQL statements.

xampp control panel

In the above screen, left panel shows list of databases, by default 'test' database is created. On the right hand side check PHP version, it is 8.0.10 in our case.

With this your XAMPP installation and verification are complete. Hope you could successfully download and install XAMPP in your system. So, now your system is ready to develop and run PHP program using localhost server.

xampp control panel downloadImportant Note

  1. If you have WAMP already installed and working, then you do not need to install XAMPP again. Your localhost server is already working for PHP. However, if WAMP is not in working condition, then you can uninstall WAMP and install XAMPP. If WAMP is used then home directory will be 'wamp/www' instead of 'xampp/htdocs'.

Watch YouTube Video

install xampp for windowsConclusion

For PHP development XAMPP/WAMP are very useful. Once you installed it successfully you are all set to write PHP program and execute them in your localhost server. These are simple to install and you do not need to configure anything, just install, start the server and work on your development.

In this topic I have showed you how you can download and install XAMPP so that you can develop and run PHP program using MySQL database. Please read the topic How to write PHP code with examples for beginners to see how you can write your first PHP program.