Re: Can i run php script using command prompt in any location by typing scriptname.php

Walter Torres <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <[email protected]>
Quoting Ravi Joshi <[email protected]>:

> Hi,
>        I have downloaded ZendServer-CE-4.0.3-Windows_x86.exe(49.6   
> MB) and installed it in C:\Program Files\Zend derectory .Whenever i   
> want to run any php script i have to put my php script in C:\Program  
>  Files\Zend\ZendServer\bin directory and then by the command prompt   
> first i goto in C:\Program Files\Zend\ZendServer\bin location and   
> then i type php scriptname.php. after doing this i get the output   
> from php script.
>       I want to ask that can i run my php script by simply double   
> clicking or by command prompt only by typing scriptname.php in any   
> location.

Yes and no.

No, you can't double click it.
Yes, you can if you set up the proper association with the .php extension.

No, you can't just type the scriptname.php at the command line to run  
the script.
Yes, if you have the path to PHP executable in your PATH variable,  
then you can type...

    > php scriptname.php

Walter--
...that's the thing about people who think they hate computers.
What they really hate is lousy programmers.
    - Larry Niven and Jerry Pournelle in "Oath of Fealty"


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.