Home > DeveloperSection > Interviews > How can I execute a PHP script using command line?

Posted on    April-29-2011 12:35 AM

 1 Answer(s)
  956  View(s)
Rate this:

Amit Singh

Total Post:565

Posted on    April-29-2011 12:00 AM

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.

Don't want to miss updates? Please click the below button!

Follow MindStick