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.
Reference:
PHP command line reference
Share "How to execute PHP script from command line?"
Related snippets:
Tags:
php, script, execute, command line, terminal, run Technical term:
Execute PHP script from command line