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

What is preg_match?

546


Do I need apache for php?

626


Tell me what is pear?

558


What is the $_ server php_self variable?

503


Why do we use session?

542






How to replace a substring in a given string in php?

555


What is a namespace in php?

479


What are objects in php?

540


i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..

1681


What is static method php?

560


Explain object-oriented methodology in php?

590


What are php keywords?

541


Why echo is faster than print in php?

525


What is the use of header() function in PHP? What the Limitation of HEADER()?

576


Is array empty php?

508