Opened 20 years ago
Closed 19 years ago
#2367 closed defect (bug) (wontfix)
got_mod_rewrite crashes Apache 1.3.x on Windows
| Reported by: | Twylite | Owned by: | markjaquith |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 2.0 |
| Severity: | critical | Keywords: | mod_rewrite windows apache crash has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Created a patch based on the code in the ticket.