Some of the ini_set() calls which Provision adds to settings.php are not PHP defaults, and are not retained in the default Drupal 7 settings.php. Deploying a D7 site on Aegir currently sets these values, which can cause "non-standard" configurations (eg arg_separator.output changes the default behaviour of http_build_query()).

Opening this issue to ask what reasons we'd have to retain the D6 ini_set calls for those values not included in D7's default configuration. Setting as a docs task but this may also require work to separate the default initial configuration for D7 sites if it's decided that the D6 defaults are not suitable.

Retaining these settings may cause Aegir sites to experience issues such as #414264: arg_separator.output is not "&" or #1649364: All languages show as "unsupported" - access token failure due to POST encoding .

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xurizaemon’s picture

Issue summary: View changes

updating links for clarity

xurizaemon’s picture

Drupal D6 default.settings.php:

ini_set('arg_separator.output',     '&');
 ini_set('magic_quotes_runtime',     0);
 ini_set('magic_quotes_sybase',      0);
 ini_set('session.cache_expire',     200000);
 ini_set('session.cache_limiter',    'none');
 ini_set('session.cookie_lifetime',  2000000);
 ini_set('session.gc_maxlifetime',   200000);
 ini_set('session.save_handler',     'user');
 ini_set('session.use_cookies',      1);
 ini_set('session.use_only_cookies', 1);
 ini_set('session.use_trans_sid',    0);
 ini_set('url_rewriter.tags',        '');

D7 default.settings.php:

ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
ini_set('session.gc_maxlifetime', 200000);
ini_set('session.gc_maxlifetime', 200000);
 

There's also overrides in .htaccess and drupal_environment_initialize() on D7+

anarcat’s picture

I think we should clearly follow d7 defaults, patches welcome!

anarcat’s picture

Issue summary: View changes

Updated issue summary.

NWOM’s picture

I'm having a problem with the "arg_separator.output" line when using the new reCAPTCHA. See here: https://www.drupal.org/node/2476237

After manually removing the line from the settings.php the problem is fixed. However, after verifying the site, it gets re-added. Since the line is already set, I can't override it via local.settings.php.

Would anyone know of a workaround to permanently disable the line from being added?

Thanks in advanced.

NWOM’s picture

Nevermind. I found the file. As a workaround, I removed the line manually from /usr/share/drush/commands/provision/Provision/Config/Drupal/provision_drupal_settings.tpl.php

ShaneOnABike’s picture

For the record this is now also affecting the new recaptcha module and causing sites to not be able to logged into once installed unless this is removed :/

xurizaemon’s picture

Two years on, IMO services like recaptcha which depend on arg_separator.output = & should set it in their calls. Ideally Provision will drop these old settings AND modules like recaptcha will cope with non-default settings for arg_separator.output.

Sites may have legit reasons to set these values (idk why) & libraries which consume services requiring specific parameter formats (even sane ones!) can enforce those settings in their service calls.

Worth noting that upstream this is addressed in the recaptcha library (commit 145bf9d2), but #2530156-4: reCAPTCHA fails if arg_separator.output is not '&' says fix there is not yet supported in the Drupal recaptcha module.

Related: #2476057: reCaptcha Verification fails when arg_separator.output is not '&', #2530156: reCAPTCHA fails if arg_separator.output is not '&', Known issue with arg_separator.output

helmo’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Status: Active » Needs review
FileSize
1.23 KB

This would be the patch to use the defaults from D7. We don't have a separate template file for D6, so that would change as well, unless we create one.

D8 has none in default.settings.php so we can consider removing them from provision_drupal_settings_8.tpl.php ... unless these still offer an added value.

xurizaemon’s picture

@helmo do you think that patch will change these default settings when provisioning Drupal 6 sites? I see you covered that, but I was looking at the patch not your comment :D

Most of those D6 settings date back to a few ancient issues (#18641, #17303) when they were imported from .htaccess overrides. I think they can go, and only questions here are

(1) whether they have Aegir specific relevance since they are gone from Drupal 7+,
(2) how we provision separate settings.php for D6 and D7.


Attempting to answer (1) here by reviewing them because otherwise fear of change might stop us tidying up, but maybe it won't matter (not sure when EOL D6 is from Aegir perspective).

arg_separator.output = &

This is actively causing issues with some contrib modules / external services. Didn't see documentation for why it was added in #18641: INSTALL.txt: Include notes about Drupal subdirectories (a666c7da).

magic_quotes_runtime = 0
magic_quotes_sybase = 0

Deprecated, remove.

session.cache_expire = 200000
session.cookie_lifetime = 2000000
session.gc_maxlifetime = 200000

Default is 180. Added to default.settings.php in #17303: PHP session settings to relocate to support multiple sites, originally proposed in #2974-65: "remember me" doesn't work. Was added to work around "remember me" failing in 2003.

4f79fafb3 moved these settings from .htaccess, most were introduced in 2001 or so

session.cache_limiter = 'none'

Was this a valid value at some point? PHP docs show options "nocache, private, private_no_expire, or public" but not "none".

session.save_handler = 'user'

Previously required for session handling but apparently not needed in settings.php in D7?

session.use_cookies = 1
session.use_only_cookies = 1
session.use_trans_sid = 0

Moved to drupal_environment_initialize(), safe to remove for D7.

url_rewriter.tags = ''

No URL session IDs so no rewriting. Shouldn't be required.

helmo’s picture

@xurizaemon thanks for the thorough review.

I found most of the lines trace back to Adrian in #275953: Implement a global.inc to set up important $conf variables like the file path

My new patch separates the templates for D6 and D7.
I'm not renaming the provision_drupal_settings.tpl.php file to provision_drupal_settings_7.tpl.php just yet to keep the patch readable.

gboudrias’s picture

Issue tags: +Aegir 3.1
SocialNicheGuru’s picture

Status: Needs review » Needs work

Edit. at line 39 it should be "==" not "="

Past post:
The patch gives me this error on php 5.5 ubuntu 14.04
Drush command terminated abnormally due to an unrecoverable error. Error: Can't use function return value in write context in /usr/share/drush/commands/provision/Provision/Config/Drupal/Settings.php, line 39

    elseif (drush_drupal_major_version() = 7) { <strong><--- line 39</strong>
      $this->template = 'provision_drupal_settings.tpl.php';
    }
    elseif (drush_drupal_major_version() <= 6) {
      $this->template = 'provision_drupal_settings_6.tpl.php';
    }
formatC&#039;vt’s picture

Status: Needs work » Needs review
FileSize
8.88 KB
583 bytes

confirm, new version of patch.
this version work for me fine. RTBC.

gboudrias’s picture

Issue tags: -Aegir 3.1

  • helmo committed 99ade8f on 7.x-3.x authored by formatC'vt
    Issue #1902542 by helmo, formatC'vt: Review ini_set() block in default...
  • helmo committed b1e4b36 on 7.x-3.x
    Issue #1902542 by helmo: Rename template file
    
helmo’s picture

Status: Needs review » Fixed

Committed #12 and renamed the template file.

gboudrias’s picture

Issue tags: +Aegir 3.1

Yay!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.