How can I execute a PHP script from the command line?

I am newbie and I want to learn PHP course.To know basics of PHP I raised this question.
Asked Feb 14, 2013
I have a phpinfo.php file which if accessed from the web shows that gearman is installed. However if I run the phpinfo.php from the command line using - php phpinfo.php and grep for gearman, I don't find it. So both phps are different. I need to run a script which the php on which gearman is installed.
Answered Nov 16, 2017
Well, Php is a server side language so try to execute in on your browser because Php is a web language.
Answered Jan 23, 2018

TIP: If it's not your answer to this question, please click "Leave a Comment" button under the question to communicate with the question owner.