iamandrus iamandrus - 2 years ago 72
PHP Question

How do I handle parse and fatal errors?

I wrote a custom error handler for my site and I'm aware that PHP doesn't allow handling of parse and fatal errors. Is there something I can do to make it handle these errors? I don't want them being outputted to the user (but I want to use my error handler for them).


Answer Source

If it can't parse your script, it won't be able to parse your custom error handler.

You should have display_errors off in your php.ini and also set error_reporting to none when your site is in production.

Also, I believe set_error_handler() can handle fatal errors.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download