Apache ErrorDocument not working for PHP 500 error

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2010-02-12T14:55:35Z Indexed on 2010/03/29 20:53 UTC
Read the original article Hit count: 450

Filed under:
|

I have a number of ErrorDocuments setup in my .htaccess file for errors such as 404, 401, 403 etc which all redirect to my error page but the ErrorDocument set for a 500 error is never displayed when PHP reports a 500. The 500 code is sent to the browser and the output is blank. Is there something special I need to do to enable 500 error documents for use with PHP?

My directives look like this:

ErrorDocument 401 /errorpage.php?error=401
ErrorDocument 403 /errorpage.php?error=403
ErrorDocument 404 /errorpage.php?error=404
ErrorDocument 500 /errorpage.php?error=500

I've looked through the php.ini and can't see anything that would obviously override the Apache settings and there are no ErrorDocument directives in my httpd.conf either. Anywhere else I should be looking?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about apache

Related posts about errordocument