Re: How to set find pathes for PHP CLI?

Re: How to set find pathes for PHP CLI?

am 14.07.2009 18:27:13 von Ashley Sheridan

On Tue, 2009-07-14 at 20:46 +0400, 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"?
>
>
>
When you set the paths, did you restart the computer? Windows needs a
full restart if you edit your paths; Linux machines won't, but you've
not mentioned what your OS is.

Thanks
Ash
www.ashleysheridan.co.uk


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

How to set find pathes for PHP CLI?

am 14.07.2009 18:46:07 von tir

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"?



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

Re: How to set find pathes for PHP CLI?

am 15.07.2009 08:02:52 von tir

Linux (RHEL). PHP 5.2.



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

Re: How to set find pathes for PHP CLI?

am 21.07.2009 21:00:50 von Shawn McKenzie

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
//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