[Full Tutorial] How to run PHP program in Xampp (Step by Step)

 PHP is one of the most popular server-side programming languages or backend programming language And it runs as a web server module or command-line interface. If you want to run your first PHP code in Windows then I am going to guide you in this article We cannot Run PHP code like Other programming languages like HTML JavaScript etc.  To run PHP code we need a Xampp control panel where we have to start the Apache server to run PHP code. There are various web servers to run PHP programs like Wamp and xampp. And in this post, you will get to know how to run PHP code in the Xampp server.

How to install Xampp Server in windows 10

Xampp server is easily available and free to download by its distribution partner Apache, it also includes MySql, and Perl as well.

  1. First, go to the official website of Apache
  2. Now click on Xampp for Window.

  3. Once it is downloaded open it to install and follow the instructions 

  4. It will also allow you to easily install PHP-based applications
  5. And once you install the Xampp Server let's see how can we run our first PHP file in xampp server

How to run PHP code in Xampp

  1. First of all, go to the installation folder of Xampp.

  2. And open htdocs folder.

  3. In the folder, you have to create your first PHP file. And write the php code in this file.
  4. Now you can use the xampp control panel to start your Apache server to create an environment that will enable you to run your first PHP code.

  5. Now start Apache and MySQL server in xampp control panel as shown above.
  6. Once the Apache server started you can run your first PHP code.

  7. Open Chrome browser or any Browser, type locathost/yourfilename.php and replace yourfilename.php with your PHP file name.

  8. Your PHP code result will be shown in the browser. 

Hope you enjoyed our article and learned how to run PHP code in xampp server. 



Post a Comment

Previous Post Next Post

Ads

Ad