|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-11-18 20:07 UTC] joel dot jacobson at mobigym dot se
I have installed the cgi-bin version of PHP4 on my system.
I'm using Apache-SSL 1.3.9 with SuEXEC enabled.
php-scripts that contains HTTP-headers, like this one, won't work because Apache sends "Content-Type: text/html" before PHP can send it's HTTP-headers. For an example, this script doesn't work on my system:
<?php
if (!$PHP_AUTH_USER) {
header("HTTP/1.1 401 Access Denied");
header("WWW-Authenticate: Basic realm='Admin Login'");
header("Connection: close");
exit;
}
?>
I don't know if there is a way to solve this problem, is it?
It's probably not a bug, but maybe the PHP developers could write something about this in the FAQs.
Thanks for any comments.
Best regards, Joel Jacobson
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 08:00:01 2025 UTC |
Replace header("HTTP/1.1 401 Access Denied"); with header("Status: 401 Access Denied"); and it should work.