#31370 [Opn->Bgs]: HTTP Authentication is not working. The login box keeps popping.
| From: | johannes@php.net | Date: | Sat, 01 Jan 2005 18:08:50 +0000 |
| Subject: | #31370 [Opn->Bgs]: HTTP Authentication is not working. The login box keeps popping. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-71375@lists.php.net to get a copy of this message | ||
ID: 31370
Updated by: johannes@php.net
Reported By: jaswinder_rana at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: WinXP
PHP Version: 4.3.10
New Comment:
Qutoting first sentence from
http://de2.php.net/manual/en/features.http-auth.php
"The HTTP Authentication hooks in PHP are only available
when it is running as an Apache module and is hence not
available in the CGI version."
Previous Comments:
------------------------------------------------------------------------
[2005-01-01 18:39:56] jaswinder_rana at hotmail dot com
1. safe mode is off
2. i am using apace 2 and i am using PHP as a cgi by adding following
three lines in httpd.conf
ScriptAlias /php/ "c:/PHP/"
Action application/x-httpd-php "/php/php.exe"
AddType application/x-httpd-php .php
Just to mention i am not the only one having this problem. Look at this
link
http://www.neowin.net/forum/index.php?showtopic=260290&pid=585143002&st=0
------------------------------------------------------------------------
[2005-01-01 12:25:43] nlopess@php.net
Some questions:
* Do you have safe mode on?
* And are using apache 2 module, filter or CGI?
------------------------------------------------------------------------
[2005-01-01 01:13:06] jaswinder_rana at hotmail dot com
Description:
------------
HTTP Authentication is not working. The login box keeps on coming back
and $_SESSION['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] are never
intilized. i spent 2 hours on it till i see there were same HTTP
Authentication issue with earlier PHP versions. I even upgraded to
latest fixzes from snaps.php.net and it di't still solve it.
I am using Apache 2.0.44 just in case its server's issue.
There are already issues but i din't see any with PHP4.3.10(and now
after updating from snaps.php.net PHP4.3.11)
so, i figured its good to mention so it can be fixed.
Reproduce code:
---------------
function error ($error_message)
{
echo $error_message."<BR>";
exit;
}
if ( (!isset($_SERVER['PHP_AUTH_USER'])) || $_SERVER['PHP_AUTH_USER']
!='user' || $_SERVER['PHP_AUTH_PW']!='pass')
{
header("WWW-Authenticate: Basic entrer=\"Admin\"");
header("HTTP/1.0 401 Unauthorized");
error("Unauthorized access...");
}
else
{
echo 'You are logged in..';
}
Expected result:
----------------
You are logged in..
Actual result:
--------------
Login box keeps on coming and it says $_SERVER['PHP_AUTH_PW'] undefined
index
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31370&edit=1