Currently, after a clean install of Drupal the PHP error reporting is set to 'All messages' which equals ERROR_REPORTING_DISPLAY_ALL. On this page /admin/config/development/logging we tell users that 'It is recommended that sites running on production environments do not display any errors.'

Shouldn't error reporting be set to 'none' then as a default? If a developer needs it he can always turn it on, but from a security POV I think it should initially be turned off so that inexperienced users don't run their live-sites with PHP error-reporting turned on.

One-line patch attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

janusman’s picture

Status: Needs review » Reviewed & tested by the community

Simple enough. Works. Don't know if this is what we want, though?

EDIT: Also, not a bug?

Dries’s picture

I'm not sure. If we do this, we should probably also enable caching out of the box. It seems inconsistent to disable error messages, and not to enable caching.

reglogge’s picture

@Dries: I get your point.

How about this as an alternative:
Add an entry to the status report that issues a warning when PHP error reporting is not set to 'none'.
This way we could leave it on by default but also gently remind people running production servers that they should better turn it off.

Patch attached.

reglogge’s picture

Status: Reviewed & tested by the community » Needs review

dang.

moshe weitzman’s picture

This touches on a more fundamental problem with our standard install profile. It serves multiple purposes, and thus fails at all of them. The fancy new admin features are enabled in standard yet they are not for site builders but rather for content creators. Assuming that building a site is what you want to do first, probably want overlay disabled.

I think we need a 'build a site' profile and we need a 'evaluate drupal' profile. build a site will be more technicaly modest (i.e. no overlay, has error reporting, ...). 'drupal evaluation' has all the admin features and more importantly, has sample data.

Sorry to dump that on this poor issue. Been in my head for a while now.

reglogge’s picture

@moshe weitzman: I readily agree with

This touches on a more fundamental problem with our standard install profile. It serves multiple purposes, and thus fails at all of them.

The solution to ship Drupal with different install profiles seems like overkill to me though. After all, it's only a few settings that would differ (overlay enabled/disabled, error-reporting on/off, caching on/off, maybe dashboard and contextual links enabled/disabled), the consequences of most of which have more of a nuisance value. Also, that would neccessitate some additional (and probably rather convoluted) help texts to be displayed during install. Just my 2ct.

Returning to the issue at hand, are there any reasons not to include this setting in the status report? After all it is a security issue when reporting is turned on on live sites and the status page is visited much more often (I presume) than admin/config/development/logging.

Dries’s picture

Let's assume that the non-expert profile sets things up for newbies, i.e. we should probably enable all the right settings, including error reporting.

1kenthomas’s picture

Hmm.

How about a sort of different paradigm-- for instance-- live(production) mode, dev mode?

valthebald’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Active

Bumping version and... is it still relevant with the latest profiles/distributions trend? I suppose each profile/distribution can provide default settings of it's own

scronide’s picture

I'm for turning it off.

The default settings should be what a secure production site could use, matching end-user expectations and without introducing platform dependencies. The onus should be put on developers to find and tweak settings to suit their specific development requirements, rather than non-technical administrators. I can only offer hearsay, but it's well known that the vast majority of software users never change the default settings.

A developer is much more likely to want to, and be able to, find and turn on error display than a non-developer would be to turn it off.

Caching is a grey area because it can confuse and frustrate non-developers as much as it would benefit them. I would leave it off.

scronide’s picture

FileSize
713 bytes

D8 patch to simply set the error_level to 'hide' by default.

scronide’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, error_level-688638-1.patch, failed testing.

scronide’s picture

Status: Needs work » Needs review

#11: error_level-688638-1.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, error_level-688638-1.patch, failed testing.

scronide’s picture

Issue summary: View changes

Installed 8.0.0 and, as far as I can tell, this is now the case. Errors and warnings are now hidden by default based on core/modules/system/config/install/system.logging.yml

Traced fixed to: https://www.drupal.org/node/2226761

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Status: Needs work » Closed (outdated)
Issue tags: +Bug Smash Initiative
Related issues: +#2226761: Change all default settings and config to fast/safe production values

@reglogge, thanks for creating this issue and making a patch.

It appears this was addressed in a later issue, #2226761: Change all default settings and config to fast/safe production values, I guess that makes this outdated, closing as such.