I'm trying to get authorization working with PHP.
I'm running PHP 4.1 on Apache.
My PHP code:
<?php
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}
?>
This is the error I get from the log file in apache:
malformed header from script. Bad header=HTTP/1.0 401 Unauthorized: c:/program files/apache group/apache/php/php.exe
Any help is appreciated.