Permalink
Browse files

BUGFIX Installer does not require .htaccess file to be writable if us…

…ing IIS 7 and 7.5. We assume any other server has some form of .htaccess file (from r98850)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@112104 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent c4de1cb commit d2b772726c5914a225abdf7bf8d531446088dff2 sminnee committed Oct 13, 2010
Showing with 8 additions and 2 deletions.
  1. +8 −2 install.php
View
10 install.php
@@ -283,7 +283,13 @@ function check() {
$this->requireFile('mysite', array("File permissions", "mysite/ folder exists", "There's no mysite folder."));
$this->requireFile('sapphire', array("File permissions", "sapphire/ folder exists", "There's no sapphire folder."));
$this->requireFile('cms', array("File permissions", "cms/ folder exists", "There's no cms folder."));
- $this->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null));
+
+
+ // Special case: IIS 7 and 7.5 don't need an .htaccess file, so it shouldn't have to be writable
+ if(!(isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS/7') !== false)) {
+ $this->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null));
+ }
+
$this->requireWriteable('mysite/_config.php', array("File permissions", "Is the mysite/_config.php file writeable?", null));
$this->requireWriteable('assets', array("File permissions", "Is the assets/ folder writeable?", null));
@@ -306,7 +312,7 @@ function check() {
$this->isRunningWebServer(array("Webserver Configuration", "Server software", "$webserver. Without Apache I can't tell if mod_rewrite is enabled.", $webserver));
if(function_exists('apache_get_modules')) {
$this->requireApacheModule('mod_rewrite', array("Webserver Configuration", "mod_rewrite enabled", "You need mod_rewrite to run SilverStripe CMS, but it is not enabled."));
- } elseif(strpos($webserver, 'IIS') !== false) {
+ } elseif(strpos($webserver, 'IIS/7') !== false) {
$this->requireIISRewriteModule('IIS_UrlRewriteModule', array("Webserver Configuration", "IIS URL Rewrite Module enabled", "You need to enable the IIS URL Rewrite Module, but it is not installed or enabled. Download it for IIS 7 from http://www.iis.net/expand/URLRewrite"));
} else {
$this->warning(array("Webserver Configuration", "URL rewrite enabled", "I can't tell whether any rewriting module is running. You may need to configure a rewriting rule yourself."));

0 comments on commit d2b7727

Please sign in to comment.