note 31360 added to features.commandline
| From: | Popeye at P-t-B dot com | Date: | Fri, 18 Apr 2003 13:15:05 +0000 |
| Subject: | note 31360 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46781@lists.php.net to get a copy of this message | ||
In *nix systems, use the WHICH command to show the location of the php binary executable. This is
the path to use as the first line in your php shell script file. (#!/path/to/php -q) And execute php
from the command line with the -v switch to see what version you are running.
example:
# which php
/usr/local/bin/php
# php -v
PHP 4.3.1 (cli) (built: Mar 27 2003 14:41:51)
Copyright (c) 1997-2002 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies
In the above example, you would use: #!/usr/local/bin/php
Also note that, if you do not have the current/default directory in your PATH (.), you will have to
use ./scriptfilename to execute your script file from the command line (or you will receive a
"command not found" error). Use the ENV command to show your PATH environment variable
value.
--
http://www.php.net/manual/en/features.commandline.php
http://master.php.net/manage/user-notes.php?action=edit+31360
http://master.php.net/manage/user-notes.php?action=delete+31360
http://master.php.net/manage/user-notes.php?action=reject+31360