Please turn display errors OFF

Production websites should not have big ugly php errors. If you leave display_errors on you are asking for trouble. Even worse is when this mistake is made on a site frequented by geeks of all flavors. PHP already has a “bad rap” for security (deserved or not).

The latest site to be a perpetrator of this problem? http://www.dilbert.com/ home of the great comic. (thanks to Pierre for pointing it out) But please, turn display_errors off and log them!

wt4808a44ac4d31 thumb large - here’s a pretty look at the site, recorded for posterity by webthumb.

I like to set up “environments” in my applications that deal with things like display_errors and other ini settings that can be altered at runtime that I want changed depending on if I’m debugging, testing, or deploying the application.

What’s your favorite PHP website error story?

Edit: I’ve found a couple of linkbacks saying things like “oh you shouldn’t turn errors off you should fix them” - I think you missed the point. I’m not advocating turning ERRORS off, I’m saying on a production site don’t be stupid and show them to the user - hence display_errors should be off (see, display_errors not error_reporting…errr duh). Log your errors people!

3 Responses to “Please turn display errors OFF”

  1. Philip Olson Says:

    Many official php.net mirrors leave display_errors on, and as you can imagine it’s embarrassing when an error is committed to phpweb. One day here someone will mention this setting within php.net/mirroring although now that you raised the question I have a hunch we’ll all talk about it and do something there soon… :)

  2. Balu Says:

    My favorite PHP website error story is about a hoster that disabled display_errors, did not log them (or at least didn’t allow me to access those logs) and also forbid to change the setting myself.

    Finding a bug that was not reproducable on a development machine was really fun this way.

  3. Pierre Says:

    My favorite error website was StudiVZ (a german Facebook clone) - some file couldn’t be located, and the path it has been searched for was “/var/www/clone/facebook” … great deal!

Leave a Reply

April 2008
S M T W T F S
« Mar    
 12345
6789101112
13141516171819
20212223242526
27282930  
Register
Login