faqts : Computers : Programming : Languages : PHP : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

33 of 39 people (85%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

$PHP_AUTH_USER is not set from the Authentication box, PHP is running as Apache Modulem Why?

Jan 24th, 2009 09:12
Brad Kint, Philip Olson, yadava aryal,


There could be several possible reasons, here are a few:
1) The register_globals setting is off (it's off by default as of PHP
   4.2.0) and if so it will not be set.  Regardless of the setting you
   could (should) use $_SERVER['PHP_AUTH_USER']
2) There is a bug in PHP 5.0.0 which causes PHP_AUTH_USER to not exist
   so if you're using this version...that's why.
3) When safe_mode is enabled, PHP_AUTH_* variables are not available when
   an external auth system is used. (As of PHP 4.3.0)
4) Try REMOTE_USER instead
5) Or, you're simply not writing proper code, be sure to read the
   following:
   http://www.php.net/features.http-auth
http://forsakringguide.blogspot.com
http://ghiddeasigurare.blogspot.com
http://guidedelassurance.blogspot.com
http://reiseneuropa1.blogspot.com
http://europadecalatorie.blogspot.com
http://reizeneuropa1.blogspot.com
http://rejsereuropa.blogspot.com
http://consiglibellezza1.blogspot.com