Question about HTTP_ENV_VARS, PHP, and Apache
| From: | Michael Sims | Date: | Wed, 16 Jan 2002 03:32:05 +0000 |
| Subject: | Question about HTTP_ENV_VARS, PHP, and Apache | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-80651@lists.php.net to get a copy of this message | ||
This may be more of an Apache question, but I was hoping that someone here would have an idea about this.
I tracked down a bug in one of my scripts that was caused by environment variable that was being registered as global without my knowledge (due to the register_globals setting). My script was depending on this variable not being set in certain conditions but I didn't take into account the fact that it could be set via an environment variable.
While troubleshooting this I was looking through the output of phpinfo() and I found something curious in the environment variables across the three different servers that I administer. All three are running Redhat, Apache 1.3.19, and PHP 4.0.4.pl1, with PHP compiled as an Apache module (--with-apxs). One of the servers is Redhat 7.0, the other two are Redhat 7.1. On both the Redhat 7.1 servers, phpinfo() reports the following environment variables:
user: michaels
logname: michaels
bash_env: /home/michaels/.bashrc
mail: /var/spool/mail/michaels
"michaels" is the user account that I use on these servers to do a majority of my work, only su'ing to root when absolutely necessary.
I'm confused as to why these variables exist. I know for a fact that Apache is running as "nobody". That's what the httpd.conf file is configured for and I can verify that by viewing the output of "ps aux" I did build apache and php as this user, but I su'ed to root for the "make install" portion. I launched apache with "apachectl" as root.
On the Redhat 7.0 machine these env vars don't exist.
Can anyone enlighten me or perhaps point me to a source of more info? Any help would be appreciated...