Recommended Posts

About a month ago I finally decided to look into wrapping PHP error reporting, to display better errors, and this is the result. PHP Error gives you prettier output, making it easier to 'get' an error in less time. This includes a fully syntax highlighted stack trace, code snippets, improved error messages, and it replaces the output so they aren't hidden behind any HTML or off screen.

What is really special is that it also works with ajax too. When an error strikes, your JS callback is put on hold, and the stack trace is displayed within the page. This allows you to fit the error, and then hit retry, without a page refresh. This feature requires no changes to your JS code, browser extensions, or anything like that. It just works out of the box.

It's also built with deployment in mind, or more how to avoid deploying it. It's simple to integrate (just two lines of code), so you don't need to tie your project to it. You can also run via php.ini, allowing you to keep it entirely out of your projects. Instructions on how to do this are provided on it's GitHub repository.

It can also be globally disabled through php.ini, in case you do accidentally deploy to production, and will only run if 'display_errors' is on anyway.

I've found this very useful on my own sites, especially when I hit an error which isn't related to what I'm working on. I get some insight when it's reported, allowing me to find and fix it slightly sooner.

I others find it as useful as I have.

  • Like 4
This topic is now closed to further replies.