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

Explain me what are the main error types in php and how do they differ?

740


What is the use of the function 'imagetypes()'?

728


How do you check if a variable has been set in php?

717


sort term descripttion form, report and uery

1941


When sessions ends?

728


Is runtime polymorphism overriding?

670


How you can update memcached when you make changes to php?

833


When do you use define() and when do you use const. What are the main differences between those two?

801


Is empty array php?

729


Which is better php or nodejs?

701


Explain the value of the variable input is a string 1,2,3,4,5,6,7. How would you get the sum of the integers contained inside input?

770


What is the use of the function htmlentities?

829


How can you get web browser’s details using PHP?

713


What is php dependency injection?

683


What does namespace mean in php?

764