- Instant help with your Php coding problems

Execute PHP script from command line

Question:
How to execute PHP script from command line?
Answer:
php info.php
Description:

Sometimes it is necessary to run a PHP script directly from the command line. In this case, simply specify the name of the file to run as a parameter. 

Using the -f option you can parse and execute the specified file. The -f  is optional and may be omitted - providing just the filename to execute is sufficient.

Share "How to execute PHP script from command line?"
Tags:
php, script, execute, command line, terminal, run
Technical term:
Execute PHP script from command line
Interesting things
ChatGPT in a nutshell