Page 1 of 1

error_reporting(0); question

Posted: Tue Oct 04, 2011 8:52 am
by dnow
Hello, This is my first time posting here I'm a new member. I have a question in regards to the error_reporting(0); php function.

I wrote some simple php code for a cs project, Unfortunately when i ran it i received an email from my institution that I have excessive error reports (about 2 million) in a day span.

I was wondering if i add "error_reporting(0);" to my php code will their server still pick up the errors?

Thank you!

Re: error_reporting(0); question

Posted: Tue Oct 04, 2011 12:30 pm
by twinedev
it will still log to system error files. When developing code, I usually throw in error_reporting(-1); to display everything to me. IMO, there is never a decent reason for anything to write to an error log (even warnings or notices).

Ask them for a sample of the errors if you do not have access to them so that you can fix them. If not, consider writing your own error handler that will stop execution so at least when you run it, you should only be getting a single error reported.

-Greg

Re: error_reporting(0); question

Posted: Tue Oct 04, 2011 4:15 pm
by McInfo
twinedev wrote:it will still log to system error files.
You might be thinking of display_errors, which will hide error messages from the user but still allow them to be recorded in the error log. However, setting error_reporting to a restrictive level will prevent the messages from appearing anywhere, including the error log.

Re: error_reporting(0); question

Posted: Tue Oct 04, 2011 4:34 pm
by pickle
I'd see about setting the display_errors ini setting so you can seen those errors on the screen & fix 'em.