ID: 29181 Updated by: [EMAIL PROTECTED] Reported By: revengeofthecats at hotmail dot com -Status: Open +Status: Bogus Bug Type: Apache related Operating System: Windows XP PHP Version: 5.0.0 New Comment:
Duplicate. See #29132 Previous Comments: ------------------------------------------------------------------------ [2004-07-15 11:13:50] revengeofthecats at hotmail dot com Description: ------------ The HTML basic authentication support has stopped working for me after upgrading to PHP5. I'm using Apache 1.3.31 and PHP5.0.0; the *exact* same setup but with PHP4.3.7 works fine. The only change to my php.ini file is changing the include/extensions directory and loading the mysql extensions, which does not seem to be related to the problem. To reproduce the bug, one may use the first sample script at http://www.php.net/manual/en/features.http-auth.php. You will be asked time and again for your username and password, no matter what you enter. A little investigation using phpinfo() shows that the $_SERVER['PHP_AUTH_USER'] and $_SERVER['AUTH_TYPE'] are not set. $_SERVER['PHP_AUTH_PW'] is correctly set, however. Reproduce code: --------------- example at http://www.php.net/manual/en/features.http-auth.php <?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); echo 'Text to send if user hits Cancel button'; exit; } else { echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>"; echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>"; } ?> Expected result: ---------------- After entering username and password, they are displayed. Actual result: -------------- The code keeps asking for username/password time and again. $_SERVER['PHP_AUTH_USER'] is not set. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29181&edit=1
