top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How a PHP script can be executed using Command Line?

+1 vote
674 views
How a PHP script can be executed using Command Line?
posted May 28, 2014 by Amanpreet Kaur

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

3 Answers

+1 vote

you can use php -f option to specify the file to be executed

answer May 28, 2014 by Shyam Purkayastha
+1 vote

I am assuming that you are using the Linux command line:

One option you have to install php shell (http://www.phpsh.org/ ) and another one what @Shyam has suggested i.e. $ php <filename> (-f is optional)

answer May 28, 2014 by Salil Agrawal
+1 vote

Just Run the PHP Command Line Interface(CLI) program and provide the PHP script file name as the command line argument.

answer May 29, 2014 by Sachin Dahda
...