Re: How to set find pathes for PHP CLI?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux