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 is the meaning of xdebug?
How to track user logged out or not? When user is idle?
What is the most common http method?
When do you use define() and when do you use const. What are the main differences between those two?
Differences between get, post and request methods ?
Why should I learn php?
Any good PHP developer looking for change
How do you remove whitespace from the beginning and end of a $string variable?
What is the meaning of curl , which is used while connecting with pay pal? and how it works?
How to create a session? How to set a value in session? How to remove data from a session?
What is the difference between mysql_fetch_array() and mysql_fetch_assoc()?
How does firefox manage cookies?