The following steps are required for executing PHP script using Command Line-
1.Create a PHP file and you can follow the following one: file_name.php, pr1.php
2.Open command prompt to change the directory into the folder containing the PHP files you created.
3.Enter the following command into command prompt to run the script file which you created and as an example the following can be followed based on the name of the file which is used here as example:
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
The following steps are required for executing PHP script using Command Line-
1.Create a PHP file and you can follow the following one:
file_name.php, pr1.php
2.Open command prompt to change the directory into the folder containing the PHP files you created.
3.Enter the following command into command prompt to run the script file which you created and as an example the following can be followed based on the name of the file which is used here as example:
D:\php_project\php pr1.php
php filename.