WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#2367 closed defect (bug) (wontfix)

got_mod_rewrite crashes Apache 1.3.x on Windows

Reported by: Twylite Owned by: markjaquith
Milestone: Priority: normal
Severity: critical Version: 2.0
Component: Administration Keywords: mod_rewrite windows apache crash has-patch
Focuses: Cc:

Description

There is a known bug with Apache 1.3.x on Windows in which calling apache_get_modules() will cause Apache to crash. See http://bugs.php.net/bug.php?id=33292 .

The problem can be reproduced in a WAMP environment by attempting to modify the Permalink options, which causes got_mod_rewrite in admin-functions.php to be called.

Suggested resolution:

The problem can be resolved by adding the following code into got_mod_rewrite in admin-functions.php:

if ( function_exists('apache_get_modules') ) {

  if (preg_match("/apache\/1\.3.*\(win/i", $_SERVER['SERVER_SOFTWARE'])) {
    // Running Apache 1.3.x on Windows -- 
    // see bug http://bugs.php.net/bug.php?id=33292
    return true;
  }

  if ( !in_array('mod_rewrite', apache_get_modules()) )
    return false;
}

This checks for Apache 1.3.x running on Windows, and assumes that mod_rewrite is present. If this check were to return false, then save_mod_rewrite_rules() will not write to .htaccess, and the permalink structure cannot be updated.

Attachments (1)

2367.diff (573 bytes) - added by Nazgul 8 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 davidhouse8 years ago

  • Keywords bg|has-patch added

comment:2 davidhouse8 years ago

  • Keywords bg|commit added

comment:3 markjaquith8 years ago

  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

comment:4 foolswisdom8 years ago

  • Keywords has-patch commit added; bg|has-patch bg|commit removed
  • Milestone changed from 2.0.1 to 2.1

Nazgul8 years ago

comment:5 Nazgul8 years ago

  • Keywords commit removed

Created a patch based on the code in the ticket.

comment:6 matt7 years ago

  • Milestone changed from 2.1 to 2.2

comment:7 rob1n7 years ago

  • Milestone 2.2 deleted
  • Resolution set to wontfix
  • Status changed from assigned to closed

This was fixed in PHP CVS in April of 2006, and hasn't been a problem at all.

Note: See TracTickets for help on using tickets.