I'm trying to get Authentication working.
This is my code:
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}
The webpage however gives me a 500/Internal error.
This is the excerpt from the server logs:
malformed header from script. Bad header=HTTP/1.0 401 Unauthorized: c:/path_to_php/php.exe
Any thoughts? My guess is that I have to re-configure something in my Apache config file, but what?
Thanks!