I'm trying to get PHP authentication (using the headers to request
authentication, and then checking $_SERVER[PHP_AUTH_USER] and
$_SERVER[PHP_AUTH_PW]) - however, no matter what I do, I can't seem to get
it to work. The login request box pops up fine, but when I enter the correct
details, it just pops back up again, and then again, before finally dumping
me at the authentication failed page. I've tried looking at phpinfo(), and
PHP_AUTH_USER and PHP_AUTH_PASSWD are definitely not being filled. Having
browsed google, I came up with two possible answers:
1. I'm already using basic HTTP authentication via apache, and so (for
security reasons) PHP doesn't get passed the user and password.
This isn't the case - authentication is definitely switched off, and
AuthType doesn't occur anywhere in my apache config. I've tried switching
authentication on, and this means that the REMOTE_USER field gets filled, as
expected, but has no effect on PHP_AUTH_USER (also as expected).
2. I'm using the CGI version of PHP, rather than the Apache module.
I don't think this is the case, but phpinfo() reports the PHP server API as
"Apache 2.0 Filter", rather than anything clearcut. Does this mean I'm using
the module or not?
For reference, I'm running:
Mandrake 9.1
Apache 2.0.47
PHP 4.3.1
Any suggestions would be gratefully appreciated - if you'd like the full
output of my phpinfo(), or the exact script I'm using (although I've tried a
number of PHP authentication test scripts without any difference in
results), then let me know. Finally, if it turns out I'm not using a PHP
module, how can I set apache up so that it does? (I've tried adding
LoadModule lines to my http2.conf, which doesn't make any difference).
Thanks.
authentication, and then checking $_SERVER[PHP_AUTH_USER] and
$_SERVER[PHP_AUTH_PW]) - however, no matter what I do, I can't seem to get
it to work. The login request box pops up fine, but when I enter the correct
details, it just pops back up again, and then again, before finally dumping
me at the authentication failed page. I've tried looking at phpinfo(), and
PHP_AUTH_USER and PHP_AUTH_PASSWD are definitely not being filled. Having
browsed google, I came up with two possible answers:
1. I'm already using basic HTTP authentication via apache, and so (for
security reasons) PHP doesn't get passed the user and password.
This isn't the case - authentication is definitely switched off, and
AuthType doesn't occur anywhere in my apache config. I've tried switching
authentication on, and this means that the REMOTE_USER field gets filled, as
expected, but has no effect on PHP_AUTH_USER (also as expected).
2. I'm using the CGI version of PHP, rather than the Apache module.
I don't think this is the case, but phpinfo() reports the PHP server API as
"Apache 2.0 Filter", rather than anything clearcut. Does this mean I'm using
the module or not?
For reference, I'm running:
Mandrake 9.1
Apache 2.0.47
PHP 4.3.1
Any suggestions would be gratefully appreciated - if you'd like the full
output of my phpinfo(), or the exact script I'm using (although I've tried a
number of PHP authentication test scripts without any difference in
results), then let me know. Finally, if it turns out I'm not using a PHP
module, how can I set apache up so that it does? (I've tried adding
LoadModule lines to my http2.conf, which doesn't make any difference).
Thanks.
Comment