From:             revengeofthecats at hotmail dot com
Operating system: Windows XP
PHP version:      5.0.0
PHP Bug Type:     Apache related
Bug description:  HTTP Basic AUTH support broken

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 bug report at http://bugs.php.net/?id=29181&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29181&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29181&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29181&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29181&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29181&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29181&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29181&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29181&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29181&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29181&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29181&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29181&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29181&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29181&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29181&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29181&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29181&r=float

Reply via email to