I am trying out the HTTP Authentication with PHP example from the PHP manual. Following is the code:
<?php
if (!isset($PHP_AUTH_USER)) {
header("WWW-Authenticate: Basic realm=\"localhost\"");
header("HTTP/1.0 401 Unauthorized");
echo "Text to send if user hits Cancel button\n";
exit;
} else {
echo "<p>Hello $PHP_AUTH_USER.</p>";
echo "<p>You entered $PHP_AUTH_PW as your password.</p>";
}
?>
I get the following message in my Apache server error log everytime:
"malformed header from script. Bad header=HTTP/1.0 401 Unauthorized: c:/php/php.exe"