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

If you are looking for a place to share your travel photos and stories, then try BigRoom.

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

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.