JosephLenton / PHP-Error

Better error reporting for PHP, and prettier too!
1.35k stars 151 forks source link

Set of features to safely use PHP-Error on production environment #62

Open panrafal opened 11 years ago

panrafal commented 11 years ago

This is just a merge of all my features from the other pull requests with necessary small fixes to make them work together in concert.

Additionally, you get the printout of output until the failure, and support for CLI scripts.

If you want to have consistent and safe error handling across environments, remove php_error.force_disabled on production server, and use 'display_errors' = 0 instead. You can also enable rich error messages during runtime, by using ini_set('display_errors', 1).

This way, your users won't see extensive debug information. But you can log all errors in your framework using callbacks, or send yourself an email if you want. And you can display a pretty user-facing error page in case something happens.