Bug #14550: Basic Authentication fails

From: Date: Sun, 16 Dec 2001 20:25:21 +0000
Subject: Bug #14550: Basic Authentication fails
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-7875@lists.php.net to get a copy of this message
From: sloetz@web.de Operating system: Debian Linux 2.4.12 PHP version: 4.1.0 PHP Bug Type: Website problem Bug description: Basic Authentication fails HTTP: Basic Authentication fails -------------------------------- PHP: 4.1.0 Server API: Apache (1.3.22) OS: Linux 2.4.12 (Debian) The following PHP script should trigger a basic authentication dialog in the client browser (see http://www.zend.com/manual/features.http-auth.php): <?php if(!isset($PHP_AUTH_USER)) { header("WWW-Authenticate: Basic realm=\"MyRealm\""); header("HTTP/1.0 401 Unauthorized"); echo "Text to send if user hits Cancel button\n"; exit; } else { echo "<p>Hello $PHP_AUTH_USER.</p>"; echo "<p>You entered $PHP_AUTH_PW as your password.</p>"; } ?> Under PHP 4.0.6. the script worked fine and the user was prompted for username and password. After the upgrade to PHP 4.1.0. the script does not produce the expected results, but leads to browser errors on the client side in most cases. In rare cases the authentication dialog appears and the script works as expected. Most of the times the browser reports an error message or shows an empty document: Netscape 4.77/Linux: "the document contained no data" Lynx/Linux: "Unexpected network read error; connection aborted." Netscape 4.7/Win2k: "the document contained no data" Netscape 3.0/Win2k: "the document contained no data" IE 6.0/Win2k: "server or dns not found" Opera 5.01/Win2k: "The server requested a login authentication method that is not supported" Opera 6.0 (Beta TP1) / Linux: shows an empty document If examined via telnet, the server closes the connection after the URL with the above script has been requested, e.g. telnet (domain name) 80 GET /auth.php HTTP/1.1 Host: (domain name) -> connection closed by server 16.12.2001 -- Edit bug report at: http://bugs.php.net/?id=14550&edit=1

« previous php.mirrors (#7875) next »