Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a path in apache

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
I'm using PHP, and trying to run an external program... for this to work properly,

/home/username/program/bin

needs to be in the path for the executor of the program.

I've tried

SetEnv PATH /home/username/program/bin:/bin:/usr/bin:/usr/local/bin

but it doesn't take... it shows up the same as if I didn't have the SetEnv directive at all.

If I change PATH to another variable name, it works like a charm... but that obviouslly doesn't help me any. Is this a permissions thing? Any advice?

 
Ok, so I've dug around the net quite a bit and come to realize the SetEnv directive is incapable of setting PATH or TZ... some feature/bug that's apparently been around for 8 years.

So does anyone know another way to solve my problem?
 
So, if I set my path as root then stop/start using apachectl this works! Finally!

However, this obviouslly won't help me after a reboot and such .

So I've been led to believe I can populate the envvars file with PATH=.... and that will solve that problem.

Only thing is, I don't have an envvars file, and I can't quite figure out where I'd place one.

RUnning Debian Sarge, Apache 1.3.33 and everything was installed with apt-get

Anyone know?
 
Hi,
what you could do is modify the "apachectl" script to include the path file.

ie: vi /usr/local/apache/bin/apachectl

export PATH=$PATH:/somepath/:

This way everytime you stop/start the webserver the PATH variable will contain the path you are looking for.

WarpZero Technologies
 
Looks like we came to the solution at nearly the same time... thank you.

For details in case anyone with the same issue comes across this... on the particular setup I was describing (Debian sarge) the place to make the change is actually in

/etc/init.d/apache

Which is just a wrapper script for apachectl which is used to set environment variables and the like.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top