note 94308 deleted from function.header by danbrown

From: Date: Wed, 28 Oct 2009 16:06:53 +0000
Subject: note 94308 deleted from function.header by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-162190@lists.php.net to get a copy of this message
Note Submitter: guy.paddock AT gmail DOT com ---- It looks like I might have to revise what I said earlier... In an environment where PHP is running under FastCGI, the following code: <?php header('HTTP', true, 403); echo "Nothing to see here...\n"; ?> ...produces a response with a status code of 500 and the following message in the page: "403 Forbidden The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log." Yet, the following code does what the code above was trying to do (send back 403 with "Nothing to see here..."): <?php header(' ', true, 403); echo "Nothing to see here...\n"; ?> This also works: <?php header('Status: 403'); echo "Nothing to see here...\n"; ?> This might be a bug in FastCGI, since all three ways to send the response work the same way on the exact same PHP version (5.2.11-0.dotdeb.0) running as an Apache module.

« previous php.notes (#162190) next »