|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-07-20 14:53 UTC] jani@php.net
[2009-07-20 15:03 UTC] whistl0r+php at googlemail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 18 22:00:01 2025 UTC |
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.