php cgi and $_SERVER[‘php_auth_user’] problems

Question:

I upgraded my version of PHP from 4.4.0 mod_php (scripts run as nobody) to 4.4.0 (run as my username), per the PHP version configuration panel. Now I am getting some authentication problems:

Since the upgrade I am finding that $_SERVER[‘PHP_AUTH_USER’] is now null, whereas before it was populated.

Answer :

Hi,

Try and use :

$_SERVER[‘REMOTE_USER’]

That should work. The cgi versions of php don’t have access to the HTTP vars. Check :

http://us2.php.net/features.http-auth

for more on this.

Leave a Reply

Your email address will not be published. Required fields are marked *