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 |
Is echo a function in php?
Php code to find whether a number armstrong or not?
What is csrf verification?
What is csrf token in php?
Explain array_uintersect()?
I finished my degree 4 years back. I didnt get job in software. In the time(for 4 years) i worked one kpo industries. but now i got job in php(40 employes working there) as fresher(Salary 8000). Shall i join in php. I have no knowledge about php. Can i do well in php. How will my carrier if i join in php? Please can you give your idea.? It will be more usefull to me.
What are the 3 scope levels available in php and how would you define them?
How we can retrieve the data in the result set of mysql using php?
What is the correct php command to use to catch any error messages within the code?
Is salary fixed or variable cost?
How do I run a php program in dreamweaver?
How to execute a php script from the command line?