Apache w/ PHP, Please Help!
| From: | Jon C | Date: | Thu, 18 Dec 2003 04:15:30 +0000 |
| Subject: | Apache w/ PHP, Please Help! | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-22612@lists.php.net to get a copy of this message | ||
I am running FreeBSD 5.1, Apache 2.0.48 and PHP version 4.3.4 and I am having a problem. I installed Apache correctly, php correctly and edited the httpd.conf file to this:
ScriptAlias /usr/local/bin/ "/usr/local/bin/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/usr/local/bin/php"
I have made pages ending in .php and they work fine But I have made a login.php file with the following code:
<?php
$auth = 0;
if (($PHP_AUTH_USER == "user" ) && ($PHP_AUTH_PW == "pass" )) $auth = 1;
if ( $auth != 1 ) {
header( 'WWW-Authenticate: Basic realm="Authorization Required!"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required!';
exit;
}
echo 'Success!';
?>
When I execute this file, it brings up the login box But when I enter the correct username and password it just keeps popping up and not "accepting" them.
Is there anyway to fix this error?
Thanks, Jon.
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca