In PHP is it possible to change the HTML of the White Page of Death (WPOD)? The goal is to do this change so that all untested (not prevented with an if-else) fatal errors would show this custom page.
For example when running the following would return a WPOD when the required filed doesn't exist:
require 'some-non-existing-file.php';
But I would like to return:
<!doctype html>
<html>
<head>
<title>500</title>
<style>body { background-color: #000; }</style>
</head>
<body></body>
</html>
I've tried to setup my <VirtualHost>
to include and ErrorDocument
directive:
ErrorDocument 500 /500.html
But according to this answer, after Apache starts to process the PHP, it won't trigger an Apache Error document anymore.