Omnimaga

General Discussion => Technology and Development => Web Programming and Design => Topic started by: JL235 on July 06, 2012, 03:21:08 am

Title: I was sick of PHP error reporting, so I built this
Post by: JL235 on July 06, 2012, 03:21:08 am
About a month ago I finally decided enough was enough. PHP error errors just sucks, so I sat down and thought about building something I'd actually enjoy seeing.

This is the result, PHP Error (http://phperror.net). It replaces the output with a fully syntax highlighted stack trace, with code snippets, and makes some error messages more meaningful. There is an example on the site, and it works for ajax requests too out of the box.

I've found it surprisingly productive to use. I get errors fixed in 2 seconds instead of 10, and although that sounds minor, it helps to stop those long coding sessions from dragging.

It's also designed to be trivial to import; just two lines at the start of your site, or you can import using your php.ini file, allowing you to keep it out of your projects. I do the latter, as it allows me to easily keep it out of a live site. There are instructions on usage via it's GitHub (https://github.com/JosephLenton/PHP-Error) page.

I hope others find it as useful as I do.
Title: Re: I was sick of PHP error reporting, so I built this
Post by: Adriweb on July 06, 2012, 05:02:36 am
This looks great !

And damn, the website is awesome
Title: Re: I was sick of PHP error reporting, so I built this
Post by: aeTIos on July 06, 2012, 08:46:22 am
Wow that looks very cool and useful! Also grrreat website.
Title: Re: I was sick of PHP error reporting, so I built this
Post by: JL235 on July 07, 2012, 08:02:09 pm
Thanks, I'm glad people like it.
Title: Re: I was sick of PHP error reporting, so I built this
Post by: Juju on July 08, 2012, 12:47:56 am
Looks pretty great :D
Title: Re: I was sick of PHP error reporting, so I built this
Post by: Munchor on July 11, 2012, 05:32:24 pm
I posted (http://news.ycombinator.com/item?id=4231616) it on Hacker News, I'm sure it'll reach a much broader audience there, I can't wait to see the comments.
Title: Re: I was sick of PHP error reporting, so I built this
Post by: NanoWar on July 11, 2012, 07:55:41 pm
The code looks very very nice and clean. What IDE did you use? Comments are also great.
Title: Re: I was sick of PHP error reporting, so I built this
Post by: Deep Toaster on July 12, 2012, 02:48:40 am
That looks like a really awesome error tracking tool :o The UI and design are great.

I'll try it when I get the chance.
Title: Re: I was sick of PHP error reporting, so I built this
Post by: Sorunome on July 12, 2012, 04:03:26 am
It looks like a very nice and useful tool!
I haven't tried it yet, but can it also rickroll you? D: :P
Title: Re: I was sick of PHP error reporting, so I built this
Post by: JL235 on July 12, 2012, 04:53:19 am
It was mostly written in SublimeText2, but I've since moved back to gVim.

I also ran it through webstorm and send studio a few weeks ago, which caught two minor bugs. But tbh I wasn't very impressed with their error reporting, as I got 100s of non-errors reported too (mostly where they were just plain wrong).
Title: Re: I was sick of PHP error reporting, so I built this
Post by: Deep Toaster on July 13, 2012, 01:18:50 am
I don't really trust error-finders anymore except where they're realtime as I type and tied to an established IDE like Visual Studio. Otherwise I just go with Notepad++ or geany and deal with the errors as it runs. Which this project would be good for haha
Title: Re: I was sick of PHP error reporting, so I built this
Post by: JL235 on July 13, 2012, 02:32:44 pm
Error finders are awesome in static languages, because they are correct. In dynamic languages they often have to do a lot of guess work and prediction, or require you adding static type hints all over the place, in which case use a static language. I've also had JSLint be unable to parse large blocks of my JavaScript.

However syntax checkers are very useful, just to tell you if it will even compile or not, regardless of if there are any obvious bugs.
Title: Re: I was sick of PHP error reporting, so I built this
Post by: Netham45 on July 14, 2012, 04:23:52 pm
I'm definitely going to have to give this a try, looks really nifty.

Just a couple suggestions:
1) Allow it to be restricted to a small number of calling IPs (Ex. I want logs for my sites, but I don't want some random person getting the source if he triggers an error). This could be done just by checking a text file with a list of IPs in it or such. (I'm actually not sure if you have this implemented or not, I haven't had a chance to use it yet)

2) Make your license a bit more prominent, it was a bit hard to track down.
Title: Re: I was sick of PHP error reporting, so I built this
Post by: ExtendeD on July 15, 2012, 03:02:26 am
For 1), maybe support for a custom filter could be added. Some may want to filter by IP, others by account type (admin/user).
Title: Re: I was sick of PHP error reporting, so I built this
Post by: DJ Omnimaga on July 15, 2012, 03:04:29 am
Now that is awesome. I don't do much coding, but in some occasions I messed with PHP code before, and when an error occurs, yes it was annoying to debug. Good job :)
Title: Re: I was sick of PHP error reporting, so I built this
Post by: JL235 on July 16, 2012, 03:37:18 pm
1) Allow it to be restricted to a small number of calling IPs (Ex. I want logs for my sites, but I don't want some random person getting the source if he triggers an error). This could be done just by checking a text file with a list of IPs in it or such. (I'm actually not sure if you have this implemented or not, I haven't had a chance to use it yet)
It's not designed for use on live sites, instead for development only. However there are some features built in to help.

For example you can run it from your php.ini file, allowing you to keep it out of projects. That way when you deploy your site, PHP Error stays on your dev machine. It also only runs if display_errors (http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors) is on, and you can disable it in production. Information on setting it up from outside your projects can be found here (https://github.com/JosephLenton/PHP-Error/wiki/Example-Setup), and the php.ini options can be seen here (https://github.com/JosephLenton/PHP-Error/wiki/php.ini).

Personally I favour that to IP filtering, as with most ISPs your IP changes on a regular basis. It also means if it's disabled for you, then it's disabled for everyone; there is no maybe middle ground.

2) Make your license a bit more prominent, it was a bit hard to track down.
Noted, I'll put the license into it's own file and check it in.