httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil A. Hillard" <>
Subject Re: [users@httpd] How to get REMOTE_USER?
Date Tue, 24 Apr 2007 08:18:20 GMT

Buffalo Dickens wrote:
> Dear all, I am eager to know how to get the environment variable
> REMOTE_USER of apache 2.
> For example, I wrote this php file,
> <html>
>  <head>
>      <title>hello</title>
>  </head>
>  <body>
>      <h1>
>          Hello, <?php echo( $_SERVER[ REMOTE_USER ] ) ?>!
>      </h1>
>  </body>
> </html>
> However, it just sent output like this, "Hello, !". I don't know why.
> Actually, php work fine with apache in my system, which can be
> demonstrated by phpinfo() function. So, is it necessary for me to
> create files like .htaccess or .htpasswd in order to make my getting
> REMOTE_USER right? It seems that there is no REMOTE_USER in my system.

You need to tell Apache to authenticate the user.  Take a look at:

You should also use:


ensuring you quote the index, see the 'Array do's and don'ts' at:



Neil Hillard          

Disclaimer: This message does not necessarily reflect the
            views of Westland Helicopters Ltd.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message