Re: Environment variables...
| From: | David BERCOT | Date: | Thu, 15 Mar 2007 13:18:10 +0000 |
| Subject: | Re: Environment variables... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-250658@lists.php.net to get a copy of this message | ||
Hi,
Le Wed, 14 Mar 2007 17:37:02 -0500 (CDT),
"Richard Lynch" <ceo@l-i-e.com> a écrit :
> 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.
Yes, great... Now, I have another problem ;-)
In Debian, everything is ok. I put my variable
in /etc/apache2/httpd.conf.
But on RedHat, I don't know which file is concerned...
So, I've searched in php.ini, but I did not find a place where I can
put variables...
Do you know which is the equivalent of /etc/apache2/httpd.conf on
RedHat ?
And is it possible (and how ;-)) to put variables in the php.ini ?
Thank you very much.
David.
> 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.
> >
>
>
Attachment: [application/pgp-signature] signature.asc
Attachment: [application/pgp-signature] signature.asc