I noted yesterday that the navigation on my many D7 (but not D6) sites hosted at Pair Networks (on Ubuntu) ceased to function properly. Some experimentation revealed that clean URL handling no longer worked, though ?q=foo did. I eventually realized that an upgrade from Apache 2.4.16 to 2.4.17 was responsible. Under some configuration conditions - possibly requiring FastCGI - several server variables have changed. There's a mention of this here, and I've found related reports here and here.

Comparison between Apache 2.4.16 and 2.4.17 sites revealed that these variables had changed:

  • $_SERVER['REDIRECT_URL']
  • $_SERVER['PHP_SELF']
  • $_SERVER['SCRIPT_NAME']

The first two are now full URLs; the last has changed from /index.php to the full request URL. I don't think that REDIRECT_URL is used by Drupal, and it's not clear to me yet whether the PHP_SELF change is problematic, but the SCRIPT_NAME change does break Drupal 7's clean URL handling.

Further experimentation provided a quick-and-dirty workaround: I added the following to drupal_environment_initialize() in file includes/bootstrap.inc:

 if ($_SERVER['SERVER_SOFTWARE'] == 'Apache/2.4.17') {
   $_SERVER['SCRIPT_NAME'] = $_SERVER['ORIG_PATH_INFO'];
   $_SERVER['PHP_SELF'] = $_SERVER['ORIG_PATH_INFO'];
 }

placed just before request_path() is called:

 $_GET['q'] = request_path();

Perhaps this will help keep some other sites up until a proper resolution is found. (Pair has since rolled back their Apache upgrades for now.)

Comments

jerry created an issue. See original summary.

jerry’s picture

Issue summary: View changes

Version: 7.41 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.