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

From: Date: Sat, 04 Jul 2009 16:53:18 +0000
Subject: Re: Can i run php script using command prompt in any location by typing scriptname.php
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-29440@lists.php.net to get a copy of this message
Quoting Ravi Joshi <ravi.joshi53@yahoo.com>:
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"

« previous php.windows (#29440) next »