Thank you for your quick answer.

Yes I have seen these functions. But they don't do what I want or only
in a complicated way.

I have some programs which I want to start from terminal, crontab or the
web interface. Since they use many environment variables it is necessary
to have the same environment.

I tryed the following example.

$environment = `env`;
print $environment ;

If I do a
putenv('MYVAR=hello');
before the env I can see the variable. But I have to do this in every
script, because the environment is always reseted in every script. This
behavor is not very nice.

How can I use the same script as for the terminal environment to import
the variables permanently?


--- In [email protected], Peter O <[EMAIL PROTECTED]> wrote:
>
>
> Have you taken a look at :
> http://www.php.net/manual/en/reserved.variables.environment.php
> http://www.php.net/manual/en/function.getenv.php
> http://www.php.net/manual/en/function.putenv.php
>
>
> Peter
>
> elhobit schreef:
> >
> > Hello
> >
> > I want to use the same environment variables under PHP as in the
shell.
> >
> > For example the variable PATH in PHP is set to
> > PATH=/bin:/usr/bin
> > Since there are programs in other folders, these paths are not
> > sufficient.
> >
> > I tryed to modify the file
> > /etc/conf.d/http
> > unfortunatly it did not work.
> >
> > Does anyone know how to change and set these environment variables?
> >
> > Thanks in advance for your help.
> >
> >
>


Reply via email to