HOW CAN I EXECUTE A PHP SCRIPT USING COMMAND LINE?

Amit Singh

Total Post:565

Points:2825
Posted by  Amit Singh
PHP 
PHP
 1007  View(s)
Ratings:
Rate this:
  1. Amit Singh

    Post:565

    Points:2825
    How can I execute a PHP script using command line?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!