Re: How to set find pathes for PHP CLI?
| From: | Shawn McKenzie | Date: | Tue, 21 Jul 2009 19:00:50 +0000 |
| Subject: | Re: How to set find pathes for PHP CLI? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-295645@lists.php.net to get a copy of this message | ||
Tir wrote:
> I have many scripts that I need execute with PHP CLI. They are located in a
> few directories. I don't want to write full path to script every time when I
> start it. Therefore I've added this paths to the PATH environment variable.
> But PHP don't find my scripts. How could i set paths on which PHP would find
> my script when i call e.g. "php -f my_script.php"?
>
>
You can't do this. The path only applies to executables. If your
scripts looked like this (and they are marked executable):
#!/usr/bin/php
<?php
//myscript.php
//bla blah
?>
Then running: $/path/to/myscript.php will run your script. The php
executable is not going to search your path for the script.
--
Thanks!
-Shawn
http://www.spidean.com