Call a php script from the command line?

Hello everyone
I am trying to learn PHP and the version i am using is 5.6.23. I am running a Linux distro called Linux-Lite-64bit.
I find executing a script using localhost/filename.php or 127.0.0.1/filename.php easy enough but is there a way a noob like myself might be able to execute php scripts from the command line?

you would do,

php /path/to/script.php

Or

/path/to/php /path/to/script.php

Sponsor our Newsletter | Privacy Policy | Terms of Service