How to install XAMPP on Windows for PHP Development

To work on PHP development in your local computer you need to install XAMPP or WAMP. XAMPP provides the 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 on Windows in this topic.

mysql serverIntroduction

XAMPP stands for 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 web server, you can download for free. This works on Windows and Linux.

WAMP stands for Windows Apache MySQL and PHP. This is also free and works on Windows only. We will use XAMPP on Windows in our discussion going forward.

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

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

xampp control panelInstalltion Steps

Step 1 - Download XAMPP on windows
Step 2 - Install XAMPP on Windows
Step 3 - Verify if XAMPP installed correctly
That's it! If the above 3 steps are successful, you can develop and run a PHP program using your local system as localhost server.

Watch YouTube VideoWatch YouTube Video

Step 1 - Download XAMPP on Windows

You can search 'download xampp on windows' in Google and download it to your computer. Download the latest version. You can download from https://www.apachefriends.org/index.html also.

Step 2 - Install XAMPP on Windows

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

xampp install

If it is not already started click on the start button as in the above screenshot to start the Apache Web Server and MySQL database server. These two services should run to make your computer work as a localhost server and enable you to run PHP programs using MySQL database.

xampp server

After the services are started, you can see the Apache and MySQL services showing green in the XAMPP control panel. If you can do all the above steps without error, your XAMPP installation is complete. Now we need to perform certain verifications to see if your localhost server and MySQL database are working fine.

Step 3 - Verify if XAMPP is installed correctly

Check Windows Folder

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

xampp php

Check XAMPP Control Panel

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

download xampp

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

If the above test works fine then open the browser and type in the URL bar as 'localhost', if you see the below screen then the 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 the top menu as shown below:

download and install xampp for windows

After clicking on phpMyAdmin, you should see the phpMyAdmin screen. This is the admin panel, you can perform various MySQL database activities and run SQL statements using this admin panel.

xampp control panel

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

With this, your XAMPP installation and verification are complete. I hope you can successfully download and install XAMPP in your system. Now, your system is ready for the development of PHP programs using the localhost server.

xampp control panel downloadNote

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

install xampp for windowsConclusion

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

In this topic, I have explained how you can download and install XAMPP on Windows to develop and run PHP programs using the 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.

Post a Comment

Save my Name and Email id for future comments