Re: Setting the environment PATH
| From: | Tom Rogers | Date: | Sat, 20 Dec 2003 00:17:05 +0000 |
| Subject: | Re: Setting the environment PATH | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-173053@lists.php.net to get a copy of this message | ||
Hi,
Saturday, December 20, 2003, 2:36:40 AM, you wrote:
M> Hi, I need to add /usr/local/bin to the PATH used by my PHP web
M> application. How?
M> Br,
M> Morten
with getenv() and putenv() on a page by page basis
$newpath ='/usr/local/bin';
$current_path = getenv('PATH');
$newpath = $newpath.':'.$current_path;
putenv('PATH='.$new_path);
Now any exec shells will get the new path
--
regards,
Tom