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 difference between mysql_fetch_array() and mysql_fetch_row()?
What is a comment in php?
Explain scalar type declarations in php7?
Can php run without apache?
What is mysql_fetch_row?
how to get the value in script values
Do you know how to get the ip address of the client?
How to read a file in binary mode?
What is cookies php?
What will replacement of localhost username and password on submission a site
Tell me what should we do to be able to export data into an excel file?
Which function is used in php to check the data type of any variable?