| Tony van der Hoff 2007-04-30, 7:00 pm |
| Hi,
Mandriva Linux 2007.0, apache 1.3.37, PHP 4.4.4, mod-perl 1.30.
Having just completed a server rebuild, (from distro binary RPMs - which
have previously worked OK), I find that I was unable to access ENV["TMPDIR"]
from php scripts when running under apache. Investigation showed that
ENV["TMPDIR"] contains "/root/tmp", so the result is hardly surprising.
I also note that ENV["ENV"] contains "/root/.bashrc", and ENV["USERNAME]
contains "root".
Inserting putenv( "TMPDIR=/tmp" ); into the script works round the problem,
but is hardly a neat fix.
Running php from the command line results in the correct environment for the
current user.
Apache is running as user apache(79), group webmaster(505), and _SERVER[...]
contains the expected values; _SERVER["TMPDIR"] contains /home/tony/tmp.
OK, so PHP thinks its root. How and where does this get set, and how do I
fix it?
Any answers will receive my undying gratitude.
--
Tony van der Hoff | mailto:tony@vanderhoff.org
Buckinghamshire, England
|