fix .htaccess file crashing apache+php-cgi

This commit is contained in:
Robin Appelman 2011-08-22 17:16:37 +02:00
parent d5ba4ec825
commit d851bdac90
2 changed files with 12 additions and 8 deletions

View File

@ -1,5 +1,7 @@
ErrorDocument 404 //owncloud/core/templates/404.php ErrorDocument 404 //owncloud/core/templates/404.php
<IfModule mod_php5.c>
php_value upload_max_filesize 512M php_value upload_max_filesize 512M
php_value post_max_size 512M php_value post_max_size 512M
SetEnv htaccessWorking true SetEnv htaccessWorking true
</IfModule>
Options -Indexes Options -Indexes

View File

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