How can I get the authenticated user name under Apache using plain HTTP authentication and PHP? April 21, 2023 by Tarik I think that you are after this $username = $_SERVER['PHP_AUTH_USER']; $password = $_SERVER['PHP_AUTH_PW'];