Run PHP script from command line


I want to run a PHP script file from shell command. I tried the following but it didn’t work. It simply dumps the file content to console and doesn’t run the script:

/usr/bin/php -f

I also tried the following, as the website is PHP 7.3. In this case it doesn’t show anything on screen, and it doesn’t run either:

/usr/local/lsws/lsphp73/bin/php -f

The script runs perfectly when invoked from the browser, but not on command line.

How should it be invoked?