Hi,
I'm trying to publish a site from my dev box to my live box.
The site uses PHP Http Authentication to password protect some areas.
It works fine on my dev box. However, on my live box, PHP_AUTH_USER and PHP_AUTH_PW are always empty!
Even the standard test script below prompts for the username and password 3 times then defaults to "Unauthorized".
<?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';
var_dump($_SERVER);
exit;
} else {
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
var_dump($_SERVER);
}
?>
Both boxes are Win 2003, IIS6.
On the dev box, PHP 5.2.1 running as CGI.
On the live box, PHP 5.2.4 running as ISAPI.
I've tried absolutely everything I can think of without success. Any ideas?
Cheers