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 |
How can we display the output directly to the browser?
What is the function to count elements in an array in PHP?
what is variable scope, which variables are accessible from where and what are "undefined variable" errors?
How can we set and destroy the cookie in php?
Tell me how to retrieve a cookie value?
What advance thing in php7?
Tell me what's the difference between include and require?
Which is the Best plateform for PHP?
What is a controller php?
what is different between PHP and Asp.net?
how to include external php file in to html page?
Describe PHP error and logging information?