#18359 [Com]: PHP module seem to make trouble with authentication under Apache 2
| From: | php at a0z dot org | Date: | Thu, 08 Aug 2002 22:16:43 +0000 |
| Subject: | #18359 [Com]: PHP module seem to make trouble with authentication under Apache 2 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16330@lists.php.net to get a copy of this message | ||
ID: 18359
Comment by: php@a0z.org
Reported By: hubweb@hotmail.com
Status: Feedback
Bug Type: Apache2 related
Operating System: Windows 2000
PHP Version: 4.2.1
New Comment:
same thing happens to me, commenting out
# ErrorDocument 401 /errors/401.php
works around the problem
Previous Comments:
------------------------------------------------------------------------
[2002-07-25 11:07:38] digex@web.de
Sir, by ht-files I actually mean .htaccess-files... :-)
My Problem is exactly the same and it REALLY suxx!
------------------------------------------------------------------------
[2002-07-25 09:23:03] hubweb@hotmail.com
My problem isn't with PHP authentication, but with .htaccess files. If
PHP is not loaded, they work, but if it is loaded, I automatically get
a 401 error. But if I use PHP authentication
($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"]) it works
perfectly, but I want .htaccess files to work correctly...
------------------------------------------------------------------------
[2002-07-25 06:51:41] digex@web.de
Yes, I know that. I inserted the wrong value in my comment, since I'm
always working with variables and I thought it'd look to confusing this
way. :) Before you ask, the variables were set correctly.
------------------------------------------------------------------------
[2002-07-25 01:40:48] derick@php.net
YOu know that the Location: header should always be a full absolute
URL, including http://hostname/ ?
Derick
------------------------------------------------------------------------
[2002-07-24 18:22:44] digex@web.de
I've noticed the same since PHP4.2.1 and it still happens with
PHP4.2.2. First I thought this was an Apache2-issue, but it ain't
(Win32-Env btw).
Using static .htm(l)-> auth ok
using text-output for 401->auth ok
using .php(3|4) ->leads directly to 401-Page
it really seems like the php-parser is overriding some apache2-parts,
which checks for ht-files.
Trying to force the correct header
<?
if(!isset($PHP_AUTH_USER)) {
header("WWW-Authenticate: Basic realm=\"secured\"");
header("HTTP/1.0 401 Unauthorized");
(X) header("Location: error.php");
exit;}
else {
echo "works";
}?>
doesnt work either, when the (X)-marked Line contains a php-file.
Again the PHP-Parser processes the scripts without Apache2 interpreting
any ht-file.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18359
--
Edit this bug report at http://bugs.php.net/?id=18359&edit=1