Java Certification Training Course
- 47k Enrolled Learners
- Live Class
PHP is the most popular web backend programming language. A PHP code will run as a web server module or as a command-line interface. To run PHP for the web, you need to install a Web Server like Apache and you also need a database server like MySQL. There are various web servers for running PHP programs like WAMP & XAMPP. WAMP server is supported in windows and XAMP is supported in both Windows and Linux. In this article, you will learn how to run PHP program in Xampp server.
Let’s get started.
What is Xampp and why it is used?
It is completely free and easy to install Apache distribution containing MySQL, PHP, and Perl. First, download XAMP from https://www.apachefriends.org/download.html. In the first page, select the components you want to install.
Select the installation directory so that all the components that you choose will be installed in this directory.
XAMP also allows you to easily install PHP based applications. Bitnami module provides the easiest way to install WordPress, Drupal or Joomla among others on top of your XAMP after the installation you will see the control panel.
Once you are done with Xampp installation, let’s move ahead and see how to run a PHP file in xampp server.
Write this program in a notepad and save it as file.php or any other name.
<?php echo " hello ashok" ?>
After completion of the installation, you can use the XAMPP Control Panel to start/ stop all servers.
Start Mysql and Apache servers.
Copy file.php to htdocs (C:/Program Files/XAMPP/htdocs)
You can also create any folders inside htdocs folder and save our codes over there.
In order to get the dashboard for localhost: search http://localhost in any browser.
Now to run your code, open localhost/file.php then it gets executed.
With this we come to an end of this article. I hope you have learned about XAMP, the installation of XAMP and how to run a PHP program in Xampp.
If you found this Tutorial blog relevant, check out the PHP Certification Training by Edureka, a trusted online learning company with a network of more than 250,000 satisfied learners spread across the globe.
Got a question for us? Please mention it in the comments section of ”how to run a php program in xampp” and I will get back to you.