> In order to prevent someone from writing a script which reveals the
> password for a page that was authenticated through a traditional external
> mechanism, the PHP_AUTH variables will not be set if external authentication
> is enabled for that particular page.
> Does that mean that the database and the web server have to be on the
> same machine?
I realize you figured out your problem, but just to clarify what is meant
by "external authentication" in the documentation. As far as PHP is
concerned, any authentication not performed by PHP is external. So, if
you have mod_auth_mysql doing the authentication, for example, then you
will not have the $HTTP_AUTH_* variables set. You will have the
traditional $REMOTE_USER variable, of course, so you know who the logged
in user is, but you will not know the password. Since the password has
already been checked there is no reason for you to know it.
> My understanding of authentication it that REMOTE_USER is set whatever form
> of http authentication you use, whether it be mod_auth, mod_auth_mysql, or
> PHP (or any others there are). But PHP_AUTH_USER is only set if you are
> using PHP's http authentication hooks and even if you are using PHP's
> authentication hooks its safer to get REMOTE_USER from the environment.
Actually, took another look at the Apache-1.3 code. This is correct. If
PHP does the authentication $REMOTE_USER will be set, so my last post was
inaccurate. Still, if authentication is done outside PHP, PHP_AUTH_USER
will not be set.
Dan Roscigno wrote :118
I am having a problem with php auth not setting the
$REMOTE_USER. If
I use mod_mysql_auth the $REMOTE_USER gets set, but when I
use php auth the logfiles show a `-` for the user. I am
running php 3.0.12 and Apache 1.3.9