* Thus wrote John Wilcox ([EMAIL PROTECTED]): > I've been trying to make a simple script which just > outputs the username that the script is currently > executing under (in order to test that suexec is > working properly). I've tried using the following > line: > > <?php print $_ENV['USER']; ?>
This var isn't the USER that the process is running under, it is the USER that started apache (assuming thats your webserver). You can see all the same vars if you execute the command `env`. I also tested this: shutting down apache setenv TEST putvarinenv started apache test.php: echo getenv('TEST'); yields: 'putvarinenv' > > and it fails to produce any output and returns the > following error in my log file: "[Sun Oct 5 14:02:35 > 2003] [error] PHP Notice: Undefined index: USER in > /home/test/test.php on line 1" > > Now, I've tried the same command on another server > running PHP 4.2.0 and it correctly outputs the > username as expected. Both these machines are running > Debian Linux. if the username was expected, I'm guessing your output was root, you should really change the webserver process to something other than root (an unprivlaged user). > > Now I figure it must be some configuration setting > that is messing this up somehow, but I have no idea > where to look. I've checked out the documentation and > it states that PHP versions later than 4.2.0 use the > $_ENV global variable to access environment variables, > so it seems like I'm using it correctly. Anyways, if > anyone has any suggestions, please let me know! > Thanks in advance, Technically it is 4.1.0 (where did you see the 4.2.0?) but anything prior to that you should use $HTTP_ENV_VARS http://php.net/manual/en/language.variables.predefined.php http://php.net/manual/en/reserved.variables.php A diff of your php.ini will tell the story I'll bet a diff output would be something like: 306c306 > variables_order = "GPCS" --- < variables_order = "EGPCS" To get the user that apache is really running as you want to do something like: print `whoami`; Curt -- List Stats: http://zirzow.dyndns.org/html/mlists/php_general/ "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php