$_ENV not working for me with PHP 4.2.0

From: John Wilcox (random50k_at_yahoo.com)
Date: 10/05/03


Date: Sun, 5 Oct 2003 11:43:20 -0700 (PDT)
To: php-general@lists.php.net

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']; ?>

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.

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,

John Wilcox

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com



Relevant Pages

  • Re: login at a site.
    ... then the script redirects to ... $warning is a string to be ... Then test if the username and password entered match with the ones on ...
    (alt.php)
  • Re: form processing question
    ... see whether that username has already been taken up by someone else (a ... How can I send the text entered in the text box to a server side PHP ... ONCHANGE event to the AJAX form submission. ... That makes it execute the same script that generated the form, ...
    (comp.lang.php)
  • Re: [PHP] $_ENV not working for me with PHP 4.2.0
    ... JW> I've been trying to make a simple script which just ... JW> username as expected. ... JW> $_ENV global variable to access environment variables, ... JW> Do you Yahoo!? ...
    (php.general)
  • error connecting to Active Directory via LDAP from ASP/VBScript pg
    ... script I'm trying to implement to authenticate a user against AD. ... Dim username, password, ldapserver, ldap_path ... ' Get the ldap server name into local variable by replacing the special ... I recently put together a PHP script to connect to AD via LDAP. ...
    (microsoft.public.scripting.vbscript)
  • RE: [PHP] Pulling variables from a URL
    ... If you are using the variable $username as a variable variable type thing.. ... Single quotes ''' tells PHP 'take the ... Do you Yahoo!? ...
    (php.general)