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 |
Can we use onclick in submit button?
What is the output of the following php code?
What is the meaning of xdebug?
How do you call a constructor for a parent class?
what is the scope of php in the future if any other language is developed then may be php is loss ???
How do I debug php?
How can you increase the maximum execution time of a script in php?
Which have the fastest execution between mysql_fetch_array() and mysql_fetch_assoc()
What are the benefits of using php and mysql?
Is python similar to php?
What is php good for?
Explain converting an object?