How can I execute a PHP script using command line?
Answers were Sorted based on User's Feedback
Answer / nikunj
By using CLI ( command line interface)
On command prompt type : php filename
Is This Answer Correct ? | 33 Yes | 5 No |
Answer / tamilselvan
PHP script using command line can be executed using SAPI
(Server Application programming Interface). Using SAPI
Command Line Interface the PHP code can be passed to execute
directly
Example:
Php –r ‘print_r(get_defined_constanrs());’
From a shell, php –v will display whether the SAPI is CLI or CGI
Is This Answer Correct ? | 12 Yes | 4 No |
Answer / indra
By using CLI ( command line interface)
On command prompt type : php filename
Example:
Php –r ‘print_r(get_defined_constanrs());’
From a shell, php –v will display whether the SAPI is CLI or CGI
Is This Answer Correct ? | 4 Yes | 2 No |
What does $_files means?
What is the content of /etc directory?
What is api used for?
I am a 2007 Passed out, Jobless for almost 2.6 years. I am preparing myself as a Php programmer. Will i get a job in Php and can any one guide me please.
Do you know how to declare an array in php?
What is the use of header() function in php?
Explain the difference between require() and require_once()?
What does $_cookie means?
What is the full form of PHP?
28 Answers Apple, Nandhini, PHP,
What is the use of header in php?
How do you run a php script from the command line?
What type of language is php?