I have a PHP app running on Windows 2008 server R2, which authenticates users against Active Directory using PHP\'s LDAP library.
As per this answer, I\'m looking to use
I believe the correct index for the authenticated user is $_SERVER['REMOTE_USER'].
According to the PHP documentation, the correct index seems to be PHP_AUTH_USER.
Try using $_SERVER['PHP_AUTH_USER'].
I got it working by disabling Anonymous Authentication in IIS, and enabling Windows Authentication (I thought Windows Authentication was already enabled, but it turns out the role was simply installed.) Now $_SERVER['AUTH_USER'] and $_SERVER['REMOTE_USER'] are populated.