note 25944 added to features.commandline
| From: | phpNOSPAM at dogpoop dot cjb dot net | Date: | Sat, 12 Oct 2002 01:28:33 +0000 |
| Subject: | note 25944 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37963@lists.php.net to get a copy of this message | ||
Here are some instructions on how to make PHP files executable from the command prompt in Win2k. I
have not tested this in any other version of Windows, but I'm assuming it will work in XP, but
not 9x/Me.
There is an environment variable (control panel->system->advanced->environment variables)
named PATHEXT. This is a list of file extensions Windows will recognize as executable at the
command prompt. Add .PHP (or .PL, or .CLASS, or whatever) to this list. Windows will use the
default action associated with that file type when you execute it from the command prompt.
To set up the default action:
Open Explorer.
Go to Tools->folder options->file types
Find the extension you're looking for. If it's not there, click New to add it.
Click on the file type, then on Advanced, then New.
For the action, type "Run" or "Execute" or whatever makes sense.
For the application, type
{path to application} "%1" %*
The %* will send any command line options that you type to the program.
The application field for PHP might look like
c:\php\php.exe -f "%1" -- %*
(Note, you'll probably want to use the command line interface version php-cli.exe)
or for Java
c:\java\java.exe "%1" %*
Click OK.
Click on the action that was just added, then click Set default.
If this helps you or if you have any changes/more information I would appreciate a note. Just
remove NOSPAM from the email address.
--
http://www.php.net/manual/en/features.commandline.php
http://master.php.net/manage/user-notes.php?action=edit+25944
http://master.php.net/manage/user-notes.php?action=delete+25944
http://master.php.net/manage/user-notes.php?action=reject+25944