Problem/Motivation

Drupal 8 fails to install, despite passing the Verify requirements check, if PHP 5.6.x is being used in any configuration other than Apache with mod_php5 if the PHP configuration always_populate_raw_post_data is not set to -1 in php.ini (the default is 0). When the install fails it gives the appearance of having stalled while initializing the Install Site stage of the installation, no errors or other messages indicating the failure or underlying cause are visible to the user without checking the PHP error logs.

In order to reproduce this problem do a clean install of D8 on Nginx or Apache with PHP being run as a FastCGI or regular CGI and with the PHP configuration directive always_populate_raw_post_data unset in php.ini or set to something other than -1.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RobLoach’s picture

Issue summary: View changes
Anonymous’s picture

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

You have got something wrong because the root .htaccess in Drupal 8 sets this very thing:

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_flag session.auto_start               off
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_flag mbstring.encoding_translation    off
  # PHP 5.6 has deprecated $HTTP_RAW_POST_DATA and produces warnings if this is
  # not set.
  php_value always_populate_raw_post_data   -1
</IfModule>

I am on 5.6.10 and I do not see this error on install.

cilefen’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)
Anonymous’s picture

Status: Closed (duplicate) » Active

I don't think these issues are same. It looks same, but in the previously linked issue when the user changes the php.ini value to explicitly set always_populate_raw_data_post_data -1 it fixes the issue. But here while installation it doesn't fix the issue even after changing the php value.

Moreover I got this while using Nginx, and that .htaccess is of no use to me.

cilefen’s picture

@rajibmp Hi. You are saying that there is a warning message on install but that is different from, and not fixed by #2456025: PHP warnings in PHP 5.6 because of always_populate_raw_post_data ini setting?

By the way, if you are not already following the nginx group, here it is https://groups.drupal.org/nginx.

Beanjammin’s picture

I believe the issue is that the .htaccess setting only works on Apache and only when using mod_php (because the setting is inside an <IfModule mod_php5.c> tag.

I think it is important that the Verify Requirements stage of the install process warn users who are not using Apache and mod_php and who have not already configured php.ini to set always_populate_raw_post_data to -1 as the install will fail otherwise.

Beanjammin’s picture

The patch tests the always_populate_raw_post_data setting during the Verify Requirements step of the installation process and provides the user with information on how to edit the php.ini file if they are running PHP 5.6.0 or newer and always_populate_raw_post_data is not already set to -1.

The existing .htaccess file provides a work around for Apache with mod_php5, as noted above, however this does not work for other web servers, such as Nginx, or when PHP is used through a different interface, such as CGI. Using ini_set() in settings.php to set the value is not an available option during the install process.

Note: I believe this issue qualifies for the 'rc eligible' tag as it improves testing during the Verify Requirements stage of installation (though admittedly not in the test bot sense). I also believe this issue will catch up quite a few people as it will effect everyone who is not using mod_php5 on Apache who have not already changed always_populate_raw_post_data from its default setting in php.ini. The proposed solution does not effect any functionality or compatibility and should not be disruptive.

Beanjammin’s picture

Status: Active » Needs review
Beanjammin’s picture

Status: Needs review » Needs work

Looking at the PHP 5.6 test failures it looks like the next step is to update the BrokenSetUpTest.php test so that it works with the patch.

devurandom’s picture

Beanjammin’s picture

Could someone with more test bot knowledge have a look at what's needed to get this patch to pass under PHP 5.6? Tests seem to be working for me locally.

cilefen’s picture

@Beanjammin It seems like the 5.6 bots simply need the setting set!

kenorb’s picture

Tested and the patch works fine.

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.

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Version: 9.2.x-dev » 8.7.x-dev
Status: Needs work » Closed (outdated)
Issue tags: +Bug Smash Initiative

PHP 5.6 is no longer supported and Drupal 8 is EOL.

Closing as outdated.