php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29182 $_SERVER['PHP_AUTH_USER'] missing ?
Submitted: 2004-07-15 11:22 UTC Modified: 2004-07-15 11:51 UTC
From: herve at elma dot fr Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.0.0 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: herve at elma dot fr
New email:
PHP Version: OS:

 

 [2004-07-15 11:22 UTC] herve at elma dot fr
Description:
------------
Since I have installed PHP-5.0.0 I do not have any answer to the command $_SERVER['PHP_AUTH_USER'] ...
PHP_AUTH_USER seems to not being defined ... included in the phpinfo() ...
!?
With Apache 1.3.31, php compiled as a module.

Reproduce code:
---------------
<?php
echo "USER = ".$_SERVER['PHP_AUTH_USER'];
?>


Expected result:
----------------
The auth user name ...
as explain in the PHP documentation :
 When running under Apache as module doing HTTP authentication this variable is set to the username provided by the user.

Actual result:
--------------
'PHP_AUTH_USER' not defined.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-15 11:48 UTC] tony2001@php.net
Duplicate. See #29132
 [2004-07-15 11:51 UTC] derick@php.net
Duplicate. See #29132


 [2004-07-23 03:03 UTC] neilcurry1 at hotmail dot com
Same problem here, using Apache 1.3.31 and PHP 5.0.0 on 
Mac OS X 10.3.4.

PHP_AUTH_USER variable is blank

PHP_AUTH_PW variable works fine.

Test Script:
<?PHP

if (empty($_SERVER["PHP_AUTH_PW"]))
{
	header("WWW-Authenticate: Basic realm=\"AUTH\"");
	header("HTTP/1.0 401 Unauthorized");
	echo("Authorisation Required.");
	exit;
}
else
{
	echo("You entered " . $_SERVER["PHP_AUTH_USER"] . " 
for a username.<BR />");
	echo("You entered " . $_SERVER["PHP_AUTH_PW"] . " 
for a password.<BR />");
}
?>

If you set the loop test to PHP_AUTH_USER it just keeps 
asking for the username and password.

The result of the above script outputs nothing where the 
username should be, and the correct password you entered 
where the password should be.

Neil
 [2004-07-23 03:08 UTC] neilcurry1 at hotmail dot com
Just see the linked bug report, should have read first.

Sorry

Neil
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC