Setting an environment variable

Setting an environment variable

am 15.08.2007 19:08:57 von lskatz

Hi,
I want to run a program under php/apache that requires me to set an
environment variable. I also need to add the program's directory to
the PATH variable. In bash in my own profile, I needed to add the
following to get it to work correctly:

PATH=$PATH:$HOME/bin:/usr/local/bin/phd2fasta
export PATH

Re: Setting an environment variable

am 15.08.2007 19:14:36 von lskatz

Hi (sorry, my previous message was sent before I finished),
I want to run a program under php/apache that requires me to set an
environment variable. I also need to add the program's directory to
the PATH variable. In bash in my own profile, I needed to add the
following to get it to work correctly:

PATH=$PATH:/usr/local/bin/phd2fasta:/usr/local/bin/phred
export PATH
export PHRED_PARAMETER_FILE=/usr/local/bin/phred/phredpar.dat

How can I give the apache user these variables? I have already tried
by puting them in apachectl and restarting apache, but nothing
changed. I have also tried by using the php command setenv and the
php variable $_SERVER with no results.

Thank you for your help.

Re: Setting an environment variable

am 21.08.2007 00:58:15 von lskatz

No one has anything...? :(

Re: Setting an environment variable

am 21.08.2007 08:42:26 von unknown

Post removed (X-No-Archive: yes)

Re: Setting an environment variable

am 21.08.2007 19:25:17 von lskatz

> this is apache.configuration, you'd better off in some php related
> group.

This is totally apache related.
I need to set an environment variable (PHRED_PARAMETER_FILE) for the
apache user. The php is there only to show information.

Re: Setting an environment variable

am 24.08.2007 22:54:46 von lskatz

Just in case anyone who is doing the exact same thing as me is
looking, this is what I did. In the end, the right solution was not
to edit the environment variables but it was to edit the readEnvVar.c
file in the phred directory to this (changing around the phredpar.dat
path), and then running make again:

#ifdef ANSI_C
int readEnvVar( Option *option )
#else
int readEnvVar( option )
Option *option;
#endif
{
pstrcpy( option->parFileName,
"/......../phredpar.dat", PHRED_PATH_MAX );
return( OK );

}