How can PHP_AUTH_PWD be empty when attempting to authenticate on an SSL-encrypted page?

When attempting to authenticate on an SSL-encrypted page, the PHP_AUTH_PWD variable may be empty if the server is not configured to pass this information correctly. To solve this issue, you can use the $_SERVER['PHP_AUTH_PW'] variable instead, which should contain the password provided by the user during authentication.

$password = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '';