How can I run php program in XAMPP?
Table of Contents
Run your first PHP program in XAMPP Server on localhost
- Download and Install XAMPP.
- Create a new project in XAMPP and add your PHP program.
- Open XAMPP and run your first PHP program.
How do I run a php file?
You just follow the steps to run PHP program using command line.

- Open terminal or command line window.
- Goto the specified folder or directory where php files are present.
- Then we can run php code code using the following command: php file_name.php.
How can I run php program in XAMPP Windows 10?
How to Run a PHP Application on Windows 10 Using XAMPP
- Install XAMPP. XAMPP is the most popular PHP development environment.
- Create a database(only if our PHP app needs a DB)
- Paste/clone the PHP app to “htdocs” directory.
- Running our PHP file or project.
Do you need XAMPP to run php?
No, you need some kind of server – Wamp, Xampp, etc.

Where do I run PHP code?
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.
Where can I run PHP files?
The preferred way of running PHP files is within a web server like Apache, Nginx, or IIS—this allows you to run PHP scripts from your browser. That’s how all PHP websites work! The other way is to run PHP scripts on the command line, and it doesn’t require you to set up a web server.
Where are PHP files stored in XAMPP?
Note: PHP program must be saved in the htdocs folder, which resides inside the xampp folder, where you installed the XAMPP.
Does installing XAMPP install PHP?
XAMPP is an easy to install Apache distribution containing MariaDB, PHP, and Perl. Just download and start the installer. It’s that easy.
Where do I put PHP files in XAMPP?
Place your PHP files in the “HTDocs” folder located under the “XAMMP” folder on your C: drive. The file path is “C:pp\htdocs” for your Web server. Make sure your PHP files are saved as such; they must have the “.
How do I open XAMPP in browser?
First you need to start XAMPP. So, go to the drive where you install the XAMPP server. Generally, it’s installed in C drive. So, go to C:pp\ ….
- Lanch xampp-control.exe ( you will find it under XAMPP folder )
- Start Apache and MySql.
- Open the browser in private (incognito).
- Write as URL : localhost.