3

I'm using the built in PHP server and I'd like to suppress the strict warnings. In my php.ini file i have:

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

...but it is still printing strict and deprecated notices. I verified that I was editing the correct ini file by checking a page with phpinfo().

In the built in webserver documentation, there is no mention of special error reporting rules.

I have also tried this:

error_reporting(E_ALL ^ E_STRICT ^ E_DEPRECATED);
ini_set("display_errors", "off");
print "changed stuff";

"changed stuff" is printed, along with strict and deprecated notices.

What do I need to do to suppress these errors in the PHP built in webserver? (Can this be done?)

leech
  • 8,293
  • 7
  • 62
  • 78
  • 1
    Ack! Someone had the right answer but then deleted it! – leech Oct 09 '13 at 18:19
  • I guess he's gone. I searched through my code (it's a very old codebase) and found several instances where the error reporting was manually set. Once i removed those it worked. *check your files for error_reporting calls* – leech Oct 09 '13 at 19:18
  • You can answer your own question. Your comment helped me too. Exactly. – William George Feb 26 '15 at 14:33

2 Answers2

0

Try changing like this [Reports all errors except STRICT ]

Through Code

<?php
error_reporting(E_ALL ^ E_STRICT);

Through PHP.ini

error_reporting = E_ALL ^ E_STRICT
Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126
0

I searched through my code (it's a very old codebase) and found several instances where the error reporting was manually set. Once i removed those it worked.

Check your files for error_reporting calls

leech
  • 8,293
  • 7
  • 62
  • 78