How can I execute a PHP script using command line?

January 10, 2010 | Filed Under PHP | Comments Off

Just run the PHP CLI (Command Line Interface) program and provide the PHP script file  name as the command line argument. For example, “php  myScript.php”, assuming “php” is the command to invoke the CLI program.
Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.

Comments

Comments are closed.

© PHPInterviewQuestion.com 2009 - 2012

eXTReMe Tracker