php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49728 $_SERVER['PHP_AUTH_USER'] is not in header
Submitted: 2009-09-30 19:19 UTC Modified: 2009-10-04 18:05 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: pliu at eiu dot edu Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 5.2.10 OS: Windows XP
Private report: No CVE-ID: None
 [2009-09-30 19:19 UTC] pliu at eiu dot edu
Description:
------------
$_SERVER['PHP_AUTH_USER'] does not pass the parameter to header.  This same problem was reported and was supposed to be fixed on version PHP 5.0. Now, it happens again with Zend Server CE (PHP 5.3.1).

Reproduce code:
---------------
<?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, the username and password will be displayed on the web page.

Actual result:
--------------
In IE, the authentication window will ask 3 times for username and password.  Then, it closes, and displays "Text to send if user hits Cancel button."  In Firefox, it keeps asking for the username and pssword.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-01 16:11 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

There is no PHP 5.3.1 released, check your version..
 [2009-10-01 20:37 UTC] pliu at eiu dot edu
I made mistakbe on the version of PHP that came with Zend Server CE.  It is PHP Version 5.2.10.

Question:  Is there any way to update only PHP version within Zend Server Community Edition?

Thanks.
 [2009-10-01 22:45 UTC] carsten_sttgt at gmx dot de
> Category:    CGI related
> 
> echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
> echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your

PHP_AUTH_USER and PHP_AUTH_PW is not available in a normal CGI environment.

Regards,
Carsten
 [2009-10-02 13:04 UTC] pliu at eiu dot edu
I do not know exactly the relationship between PHP.net and Zend.com.  Can anyone provide a solution either:

1. Change Server API from CGI/FCGI with the PHP version in Zend Server CE?

2. Upgrade PHP to new version within Zend Server CE?

I like the package provided by Zend Server CE and want to keep it if possible.

Thanks.
 [2009-10-04 18:05 UTC] jani@php.net
This is not zend.com support forum. Try http://www.zend.com/ instead.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 05:01:30 2024 UTC