I am in a situation, where is a little posibility of exceeding php execution time. So my idea was to rewrite message like "Fatal error: Maximum execution time of 5 seconds exceeded on line 1" to something more 'fancy'. I am using apache.
Where does apache store these php fatal errors (or php errors in general)? If so, is there a posibility of rewrting those? Thanks.
EDIT: Note - I know where is the error log, I am asking about the actual error message, or the source of the error message if you want.
What you do want to have a look at is this: http://php.net/manual/en/function.set-error-handler.php
It lets you set a function to handle the errors, you can catch which error you had and display a customized output depending on it.
also this function might be useful for you too: http://php.net/manual/en/function.register-shutdown-function.php
It lets you run a function just before the script ends, even if it died.
It depends on your ini settings. See here for the relevant settings, in particular log_errors
, error_log
and display_errors
. If log_errors
is on, errors are logged to error_log
.
It also sounds like you're after a custom error handler, this can be achieved using set_error_handler().