It took some digging on the PHP-Win Archive but I found the answer a long
time ago... You have to be running PHP as an Apache module (not a CGI).

in Apache change :

ScriptAlias /php/ "C:/Program Files/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"

to :

LoadModule php4_module "C:/PHP/sapi/php4apache.dll"
AddType application/x-httpd-php .php

then use something like:

<?php
        if(!isset($PHP_AUTH_USER)) {
            header("WWW-Authenticate: Basic realm='private'");
            header("HTTP/1.0 401 Unauthorized");
            echo "Authorization Required.";
            exit;
        }
?>


-----Original Message-----
From: Gehring Uwe [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 1:40 AM
To: [EMAIL PROTECTED]
Subject: AW: [PHP-WIN] PHP Authentication


I am running php/CGI with IIS on Win2k with Authentification - it is
working.

Uwe

-----Ursprüngliche Nachricht-----
Von: Christoph Grottolo [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 21. Februar 2002 20:30
An: [EMAIL PROTECTED]
Betreff: Re: [PHP-WIN] PHP Authentication



"Rasmus Lerdorf" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| HTTP Auth does not work with the CGI version of PHP which is what I
| presume you are using on Windows.  Switch back to UNIX.

oh, please, dear sysadmin, set up a real good unix server for me -
that's
all you have to do?

rasmus - not everybody has full choice.

Christoph



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to