Reputation:
I am trying to achieve the following for my site; first of all, this is for production mode only. My goal is to keep all errors hidden from the visitor, but log them and display a 500 Internal Server Error Page.
The part of hiding those errors is easy - the only thing is to turn off display_errors.
Right now, I am using a custom written function as error handler. It basically just sends a 500 Error Page, but neither that seems to work. Here is the function:
function error_handler($errno, $errstr)
{
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
die();
}
Because of this, another error occurs - the errors don't get logged because I use die() at the end of this function.
Any idea how this might work?
Upvotes: 3
Views: 321