0

I have this set in php.ini:

error_reporting = E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT

Yet I'm still seeing things like this:

Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/web/wp-content/plugins/folders/includes/types.php on line 188

I would like to suppress all notices and warnings.

6
  • 2
    What does the manual say about it? Commented Oct 18, 2019 at 15:48
  • I've tried the suggestions in the manual (which uses slightly different syntax) but it produces the same result Commented Oct 18, 2019 at 15:50
  • Did you try? error_reporting(E_ALL & ~E_NOTICE); Commented Oct 18, 2019 at 15:51
  • You should probably tag it with WordPress tag. It could be relevant. Commented Oct 18, 2019 at 15:52
  • 1
    On wp-config.php set define('WP_DEBUG', false); show hide those warning Commented Oct 18, 2019 at 15:55

2 Answers 2

0

To suppress only notices and warnings set
error_reporting = E_ALL & ~E_WARNINGS & ~E_NOTICE

Sign up to request clarification or add additional context in comments.

Comments

-1

try adding this line to the beginning of your php script, that will hide all the errors.

<?php error_reporting(0);

2 Comments

I'm using WordPress so there are thousands of files
are you in local or hosting?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.