Starting with PHP is quite easy. If you’re a beginner in PHP, then this post is for you, and will make you feel comfortable in running PHP program on XAMPP Server. Begin developing your website on localhost, and then move forward and upload the website live, with a domain name and hosting account.
Let’s start with running first PHP program using XAMPP Server on localhost.
Step 1: Go to the following website and download XAMPP Server,
Step 2: After downloading, install it. You can install it at any location, but we installed it at,
Step 3: Now, go to “htdocs” folder in “Xampp” folder and create your project folder. Here in the screenshot, you can see, a folder “AmitProject” has been created,
Step 4: Now, create a file with php extension. We have created a file with name, FirstProgram.php. Add the following code in it,
Step 5: Go to start button, and type “Xampp Server” to open it. This will open “Xampp Server- Control Panel”. After opening it, just click “Start” on “Apache”. This will start the server,
Step 6: Now, go to browser and type, “localhost/AmitProject” and press enter.
On pressing enter, you can see the following, locate your PHP file,
Step 7: Just press, “FirstProgram.php” and you can see the output of your first PHP program,
Figure 7: Open FirstProgram.php and see the output
We saw how to run a PHP program using XAMPP Server on localhost. A step 7 process and you can enter the PHP world, on localhost.
Here’s the video, explaining the steps shown above,
Note: You do not have to START Apache Server again and again. But, yes, if you “shut down” and “restart” your system, then there is a need of starting the server again.
Hope you liked the tutorial, kindly share it with others.
If you have any query, then please mention in the comments section below.
Editorial Staff at Generic Whiz.