4 ms·
True. I always turned it on while developing. This saved me from a lot of buggy code. But there are a million questions on the internet about this 'error'. And
by thdrdt 7y ago
True. I always turned it on while developing. This saved me from a lot of buggy code.
But there are a million questions on the internet about this 'error'. And the answer is almost always: turn the errors off.
And I believe this is the biggest problem with PHP. A lot of inexperienced users with questions that get very bad answers.
- mpol 7y ago"Turn display_errors off" is a good answer for a production website. You will get problems with headers and cookies, if notices are printed before headers are sent. You might also divulge information about your stack to users. For a development and staging website you do want notices and warnings displayed. For a production website possibly only when testing something.
- jbboehr 7y ago> For a development and staging website you do want notices and warnings displayed. Just SSH in and tail the log. Dealing with unexpected output from errors clobbering your headers isn't worth the trouble. You can also try something like FirePHP [0] if you need the errors in the context of the current page. [0]: http://www.firephp.org/ http://www.firephp.org/