0

I am having difficulties in overriding the default PHP settings within my Drupal installation. I do not want Drupal to display E_NOTICE messages. So I wanted to override the default PHP error_reporting setting from E_ALL to E_ALL & ~E_NOTICE or from 2047 to 2039 (the corresponding error reporting values).

I added the line ini_set('error_reporting', 2039); in both sites/default/settings.php and sites/default/default.settings.php, but still when I go the status report page and view the PHP info file, I see the error reporting setting of PHP is still set to 2047. What am I doing wrong here? How to override the php setting?

PS: I even tried adding the line php_value error_reporting 2039 to Drupal's .htaccess file, but there is no effect.

2
  • Do you get any error message about ini_set() being disabled? Did you verify it is not disabled? Notice that you should not touch the default.settings.php. Drupal doesn't use that file when running; it is just used to create the settings.php file when installing Drupal.
    – apaderno
    Commented Sep 25, 2012 at 2:23
  • How about putting this log_errors = Off in your .htaccess Commented Sep 25, 2012 at 6:32

1 Answer 1

2

You will have to add

error_reporting(E_ALL ^ E_NOTICE);

to the settings.php file. Here's more.

4
  • Thanks for your answer. But it is not working.. The setting remains the same.
    – Vivek
    Commented Mar 16, 2012 at 7:43
  • do you mean that the Notice's are still displayed? But it works fine on mine. D7 btw.
    – user2948
    Commented Mar 16, 2012 at 8:08
  • Yes the notices are still getting displayed. BTW, can you check your phpinfo() for the error reporting values?
    – Vivek
    Commented Mar 16, 2012 at 8:32
  • error_reporting 30711 hope it helps :)
    – user2948
    Commented Mar 16, 2012 at 8:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.