Newbie to PHP trying to build a simple, generic framework for a simple website. Looking for simple best practices for PHP error handling.
My research indicates that I should do the following.
In my local php.ini file:
display_errors = Off
error_log = error_log // should I change this?
error_reporting = 2039
log_errors = On
As for coding I should:
1. Use ob_start() to cache output (in case I need to clear it when an error occurs)
2. Trap errors by setting a custom error handler via set_error_handler()
3. In the case of unrecoverable errors redirect to a generic error page?
Any other advice or code snippets?
Thanks!
Malcolm
My research indicates that I should do the following.
In my local php.ini file:
display_errors = Off
error_log = error_log // should I change this?
error_reporting = 2039
log_errors = On
As for coding I should:
1. Use ob_start() to cache output (in case I need to clear it when an error occurs)
2. Trap errors by setting a custom error handler via set_error_handler()
3. In the case of unrecoverable errors redirect to a generic error page?
Any other advice or code snippets?
Thanks!
Malcolm