]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix .htaccess file crashing apache+php-cgi
authorRobin Appelman <icewind1991@gmail.com>
Mon, 22 Aug 2011 15:16:37 +0000 (17:16 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Mon, 22 Aug 2011 15:18:54 +0000 (17:18 +0200)
.htaccess
lib/setup.php

index 92825ea92d5015095675570a60a9670400002aa2..181248267559e377dbac74e01b395cbc215558f6 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -1,5 +1,7 @@
 ErrorDocument 404 //owncloud/core/templates/404.php
-php_value upload_max_filesize 512M
-php_value post_max_size 512M
-SetEnv htaccessWorking true
+<IfModule mod_php5.c>
+       php_value upload_max_filesize 512M
+       php_value post_max_size 512M
+       SetEnv htaccessWorking true
+</IfModule>
 Options -Indexes
index 8386846358b04e8264fd710392913316af290e74..9f31b47c0e5d55645c7b8eb9af5561e4c3c3a893 100644 (file)
@@ -273,12 +273,14 @@ class OC_Setup {
         * create .htaccess files for apache hosts
         */
        private static function createHtaccess() {
-               global $SERVERROOT;
-               global $WEBROOT;
+               $SERVERROOT=OC::$SERVERROOT;
+               $WEBROOT=OC::$WEBROOT;
                $content = "ErrorDocument 404 /$WEBROOT/core/templates/404.php\n";//custom 404 error page
-               $content.= "php_value upload_max_filesize 20M\n";//upload limit
-               $content.= "php_value post_max_size 20M\n";
-               $content.= "SetEnv htaccessWorking true\n";
+               $content.= '<IfModule mod_php5.c>';
+               $content.= 'php_value upload_max_filesize 512M';//upload limit
+               $content.= 'php_value post_max_size 512M';
+               $content.= 'SetEnv htaccessWorking true';
+               $content.= '</IfModule>';
                $content.= "Options -Indexes\n";
                @file_put_contents($SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it