#48985 [Opn->Bgs]: No/empty output is send to the client when HTTP status is set with header()
| From: | jani@php.net | Date: | Mon, 20 Jul 2009 14:53:43 +0000 |
| Subject: | #48985 [Opn->Bgs]: No/empty output is send to the client when HTTP status is set with header() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-139969@lists.php.net to get a copy of this message | ||
ID: 48985
Updated by: jani@php.net
Reported By: whistl0r+php at googlemail dot com
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Windows
PHP Version: 5.2.10
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2009-07-20 13:25:00] whistl0r+php at googlemail dot com
Description:
------------
I want to create a custom error page.
In the script I set the HTTP status to the given error and want to
display a custom text.
The script will work on Linux/Unix systems and even on Windows with
IIS, but not on Windows with Apache.
I tested the current stable and snapshot releases of PHP 5.2.10 and
5.3.0. Tested from Apache 2.0.63 to Apache 2.2.11. Tested on Windows XP,
Server 2003, Vista, Server 2008 and Windows 7.
Reproduce code:
---------------
<?php
header('HTTP/1.1 404 Not Found');
echo 'My custom 404 page';
Expected result:
----------------
I expected to see a page with the text "My custom 404 page" and it's
response header with the HTTP status set to 404.
Actual result:
--------------
On any Windows system with Apache as webserver, you won't see the text
"My custom 404 page", instead each browser will show an error message
based on the HTTP status, indicating that they were unable to render the
content.
In my tests it doesn't matter if you use PHP as CGI or module.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48985&edit=1