Re: $_ENV not working for me with PHP 4.2.0

From: Date: Mon, 06 Oct 2003 02:55:25 +0000
Subject: Re: $_ENV not working for me with PHP 4.2.0
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-165121@lists.php.net to get a copy of this message
Hi, Monday, October 6, 2003, 4:43:20 AM, you wrote: JW> I've been trying to make a simple script which just JW> outputs the username that the script is currently JW> executing under (in order to test that suexec is JW> working properly). I've tried using the following JW> line: JW> <?php print $_ENV['USER']; ?> JW> and it fails to produce any output and returns the JW> following error in my log file: "[Sun Oct 5 14:02:35 JW> 2003] [error] PHP Notice: Undefined index: USER in JW> /home/test/test.php on line 1" JW> Now, I've tried the same command on another server JW> running PHP 4.2.0 and it correctly outputs the JW> username as expected. Both these machines are running JW> Debian Linux. JW> Now I figure it must be some configuration setting JW> that is messing this up somehow, but I have no idea JW> where to look. I've checked out the documentation and JW> it states that PHP versions later than 4.2.0 use the JW> $_ENV global variable to access environment variables, JW> so it seems like I'm using it correctly. Anyways, if JW> anyone has any suggestions, please let me know! JW> Thanks in advance, JW> John Wilcox JW> __________________________________ JW> Do you Yahoo!? JW> The New Yahoo! Shopping - with improved product search JW> http://shopping.yahoo.com Do this to see what is available in your enviroment, it would seem that USER is not being set by the system or is called something else. echo printenv; (use backticks) -- regards, Tom

« previous php.general (#165121) next »