Search code examples
phperror-reporting

error_reporting(0) throws 500 error


So - strange situation I got here.

The statement error_reporting(0); has been giving me a server 500 error.

However, error_reporting(1); works just fine..

And its killing me, too many warnings for some of my URL validators. What's up with this? Any idea on how this can be fixed?


Solution

  • First of all, I'm sorry if I behave "smartass", but I have to tell you that if there are warnings, you should consider to fix them instead of just reduce them to silence... :)

    Junk PHP code let bad things happen, and you won't like it. I understand 80% of the PHP code around is junk, but really try to fix that library, if it's not huge.

    We can however try to solve the problem if you just make a simple .php file, with only one line:

    <?php
    error_reporting(0);
    ?>
    

    and test if it fires the error. If it doesn't, the problem is not caused by error_reporting, but just triggered by it, and there's some sick stuff going on elsewhere. :)