Re: Environment variables...
| From: | Erik Jones | Date: | Wed, 14 Mar 2007 18:24:22 +0000 |
| Subject: | Re: Environment variables... | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-250604@lists.php.net to get a copy of this message | ||
Well, as David BERCOT pointed out, if this is in a web environment then the environment available to php will be that of whatever user your web server is running as (probably 'nobody' if you're on apache, not sure about other web servers). So, you'll need to look at making that variable available in you're web server user's env.
On Mar 14, 2007, at 9:52 AM, David BERCOT wrote:
Le Wed, 14 Mar 2007 09:42:13 -0500, Erik Jones <erik@myemma.com> a écrit :erik jones <erik@myemma.com> sofware developer 615-296-0838 emma(r)Depending on your system and environment (platform and cli v. cgi), they should be in either of the $_ENV or $_SESSION superglobals.It is Debian... But the variable I added is not in $_ENV or $_SESSION superglobals... David.On Mar 14, 2007, at 9:32 AM, David BERCOT wrote:Hi, I'd like to read an environment variable with PHP. I've tried with : exec ('echo $CONTEXTE_D_EXECUTION',$result); $result is empty !!! I've put the variable in /etc/environment, in /etc/profile, in /etc/bash.bashrc but nothing worked... Do you have any idea ? If it is not possible, I suppose I can put a variable in php.ini ? Thank you very much. David.erik jones <erik@myemma.com> sofware developer 615-296-0838 emma(r)