|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-03-05 11:48 UTC] sas at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 13 13:00:01 2026 UTC |
I am running 3.0.15, but bug database form doesn't have that as an option. I need to modify the PATH environment variable in my script. I get the current value with getenv("PATH"), then modify it with putenv. If I do a subsequent getenv("PATH") to verify the change, it is not shown. phpinfo(), however, shows the changed variable. But is it being made available to child processes? The following script reproduces the problem on both HPUX 10.20 and Solaris 7 running Apache 1.3.12 with PHP as a DSO. <? # Fetch PATH env var $path = getenv("PATH"); echo $path . "<BR>\n"; # Append to the path putenv("PATH=$path:/foo/bar"); # Print the changed path (?) echo getenv("PATH") . "<BR>\n"; # phpinfo shows it correctly phpinfo(); ?> The problem appears to only afflict the PATH variable; others work fine.