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.
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.
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.
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 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:
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.
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:
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.
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.