How can I execute a PHP script using command line?
Answer Posted / 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 |
Post New Answer View All Answers
How to enable cURL in PHP?
hello all, I need some sample placement papers in lion bridge.. can anyone help me?
Which function can be used to delete a file?
Tell me how can we get the error when there is a problem to upload a file?
What are php variables?
What is a definer in mysql?
What is inheritance in php? How many types of inheritance supports php?
Can we use session in mvc?
What is global array in php?
What's php?
> symbol is used to redirect the output of a command. State Whether True or False?
When to use get and post request?
What is the meaning of "enctype= multipart/form-data" ?
Is php better than java?
Is it worth learning php in 2019?