Re: Environment variables...

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

 



PHP runs as its own user in its own environment.

Stuff you cram into your environment has no effect on that, as it
should be.

If you alter the environment of the PHP user you might get what you want.

You may also be able to use http://php.net/setenv

And http://php.net/getenv is probably faster than your exec.

Setting the env up in httpd.conf and/or php.ini and/or .htaccess
should work.  httpd.conf for sure, others I think.

On Wed, March 14, 2007 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.
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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