For all those having problems with the PHP_AUTH_USER not being set run the function phpinfo(). If you see Server API set as "ISAPI" you will not be able to get the PHP_AUTH_USER variable. Below find an excerpt from
http://www.zend.com/manual/features.http-auth.php
-------------------------------------
Also note that this does not work using Microsoft's IIS server and the CGI version of PHP due to a limitation of IIS. If you're using the IIS module (ISAPI), you may use the HTTP_AUTHORIZATION variable for example: list($user, $pw) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
-------------------------------------
Regards,
Kevin