How do you run a php script from the command line?

Answer Posted / suren

Answer :
you can execute thefrom anywhere like a command prompt.

in unix like OS you use the following:
/path/to/php -f /path/to/script.php

For windows OS's use the following
c:\path\to\php.exe -f c:\path\to\script.php

and U can get the information by running the
C:\path\to\php.exe -f

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you access a get requests url parameter with php?

753


What is orm in php framework?

755


What is new static in php?

720


Is php better than python?

739


What is php key?

704


Why json is used in php?

751


Do you know what is the difference between the include() and require() functions?

753


Tell me what are the functions to be used to get the image's properties (size, width and height)?

803


How can I load data from a text file into a table?

781


What is the difference between htmlentities and htmlspecialchars in php?

711


What does == mean in php?

751


Explain how can we increase the execution time of a php script?

751


Which function is used to strip whitespace?

703


Does php support multithreading?

778


Is it possible to protect special characters in a query string?

777