I developed a REST API in PHP. Is there any way I can get alerted when a PHP script has a fatal error? Ideally I'd like to get an email with the error that occurred.
Asked
Active
Viewed 27 times
0
-
2http://stackoverflow.com/questions/7792394/how-to-email-php-fatal-errors-only :) – MartinMouritzen Jul 11 '16 at 17:30
-
Well, fatal kind of implies not much else is going to happen .... – Bart Friederichs Jul 11 '16 at 17:30
-
@BartFriederichs It does, but not in PHP. `register_shutdown_function()` + `error_get_last()` can be used to log / mail fatal errors. Also many of the previously fatal errors have become exceptions in PHP 7. – Shira Jul 11 '16 at 17:41
-
Thanks, got it working! – user185813 Jul 11 '16 at 23:06