php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48985 No/empty output is send to the client when HTTP status is set with header()
Submitted: 2009-07-20 13:25 UTC Modified: 2009-07-20 15:03 UTC
From: whistl0r+php at googlemail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.10 OS: Windows
Private report: No CVE-ID: None
 [2009-07-20 13:25 UTC] 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-20 14:53 UTC] jani@php.net
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.


 [2009-07-20 15:03 UTC] whistl0r+php at googlemail dot com
When it's working on every plattform, excepted on Windows with Apache, you think it isn't a PHP problem?!)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 28 21:00:03 2025 UTC