On a PHP webapp using the Zend 1 framework, if the code throws an exception, I get a nice error page with my branding etc.

If the code encounters a PHP fatal error (e.g. "method call on non-object" when an object reference is unexpectedly null), then I just get a bare Apache 500 error page.

How can I get a nice error page in the latter case?

Things I have tried:

* If the PHP ini "display\_errors" is set, then I get just the fatal error message as plain text
* If "display\_errors" is not set, then I get the Apache default 500 error page
* The Apache "ErrorDocument" directive seems to be ignored in this case