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 do http requests work?
What is helper library?
Tell me how can we get the error when there is a problem to upload a file?
What is a php web application?
How can we access the data sent through the url with the post method?
Suppose your zend engine supports the mode <? ?> Then how can you configure your php zend engine to support <?php ?> Mode ?
WHat is the diff. between PHP4 and PHP5?
6 Answers Clarion Technologies, IBM, OmniNet, Sparkton Infotech,
Why do we need session?
What is magic quotes?
What is abstraction php?
Which php mvc framework is best?
where do we use htaccess?