How to Run PHP Scripts Using XAMPP

We all know that, XAMPP is a free open source cross platform web server solution stack package, which consist mainly Apache HTTP server, MySQL server database and interpreters for script written in the PHP and Perl Programming languages. It is a good tool for learners of PHP, Perl or mySQL. Here is the simple steps to installing the XAMP and start using this for running your PHP scripts.

Steps to run PHP Scripts Using XAMPP

1. As said above, you can download XAMPP for free. You can get your free copy from here.
2. Open the downloaded file and install the applications.
3. Once installed, run the XAMPP control panel and start Apache and MySQL servers. Enable MySQL if your program needs database.

running PHP scripts in XAMPP

4. Click on the ‘Explore’ button on the XAMPP control panel. The new window opens with file explorer.  Search for the ‘htdocs’ folder.
4. htdocs folder is the folder Apache server points to. In this folder you need to place the  PHP scripts your want to run.
5. Open the browser and enter the address http:// localhost/yourphpscript.php, where yourphpscript is the script name of your php code.
6. You can even create sub folders inside htdocs to place and run php scripts. If you are using folders insider htdocs, then you need to enter the following path in the browser address bar.
http://localhost/foldername/yourphpscript.php where ‘foldername’ is the name of the folder which contains php scripts  created inside your htdoc folder.
7. Your browser will execute the script and show the output.

Meet the Author

Hi, I am Aniruddha, an avid blogger since 2008 who likes writing about new gadgets, smartphones and excel. You can find them at www.tech2touch.com. You can also follow me on Twitter @tech2touch or my Facebook page tech2touch. You can subscribe to my YouTube channel tech2touch. Enjoy reading and watching!!!

Shares