I'm trying to get Apache to redirect to a friendly static page on fatal PHP errors, something I thought would be quite easy to do...
I have a .htaccess file which has the folllowing:
ErrorDocument 404 /404.php
ErrorDocument 500 /500.php
Within each 404.php & 500.php file I just echo some text, e.g. "hello 404"
Testing the 404 I get the desired result. However, when testing the 500 error I just get a blank page.
I have a script called cause500.php which basically has:
ini_set('display_errors', 0);
myFunctionThatDoesntExist();
I can see that a response code of 500 is being returned (using Live HTTP headers), although Apache isn't handling it via the .htaccess file??!!
I'm using WAMPP, but I also test the same setup on a shared linux host and get the same thing happening.
Any help on this will be greatly appreciated.
Dave