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!
error_reporting(0); question
Moderator: General Moderators
Re: error_reporting(0); question
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
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
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.twinedev wrote:it will still log to system error files.
Re: error_reporting(0); question
I'd see about setting the display_errors ini setting so you can seen those errors on the screen & fix 'em.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.