PHP Interview Questions
How can i execute PHP File using Command Line?
It is easy and simple to execute PHP scripts from the windows command prompt. You just follow the below steps:
 
1. Open the command prompt. Click on Start button->Command Prompt.
 
2. In the Command Prompt, write the full path to the PHP executable(php.exe) which is followed by the full path of a script that you want to execute. You must add space in between each component. It means to navigate the command to your script location.
 
For example :
 
let you have placed PHP in C:\PHP, and your script is in C:\PHP\sample-php-script.php,

then your command line will be : C:\PHP\php.exe C:\PHP\sample-php-script.php

3. Press the enter key and your script will execute.