Drupal overriding error_reporting setting in php.ini

Created on 1 September 2011, over 13 years ago
Updated 19 February 2023, almost 2 years ago

In #291026: change E_NOTICE to warning and allow selection of error level β†’ , webchick requested that this be made a new issue.

As it happens, Drupal 7 includes a rather unfortunate change, that forces PHPs error_reporting setting to E_ALL or higher, overriding the system configuration.

This incurs a significant performance overhead for error handling whenever a notice occurs, as well as a lot of useless noise in Drupal's watchdog log (and even on screen if error logging to screen has not been disabled), and given that these are mostly coding style issues and not indicative of any real problem.

Drupal should not change system configuration unnecessarily in ways that requires hacking core to undo. This is probably a well-intentioned attempt at getting developers to fix notices in their own modules. However, this is the wrong approach. System settings are not for user-space applications to thumb their nose at, and as a system administrator, I was appalled to learn that Drupal thinks it knows better how to configure my server.

If anything, we could introduce error_reporting as one of the settings in default.settings.php, but for now, the attached patch removes the line in question from bootstrap.inc.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
BaseΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡¨πŸ‡­Switzerland mikl

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024