diff --git a/INSTALL b/INSTALL index e7ff603d3..77e5a0eab 100644 --- a/INSTALL +++ b/INSTALL @@ -156,6 +156,8 @@ increase the allowed size of file attachments, for example: php_value upload_max_filesize 5M php_value post_max_size 6M +Note that some PHP environments (php-fpm) may use .user.ini instead of .htaccess. + SECURE YOUR INSTALLATION ======================== diff --git a/bin/installto.sh b/bin/installto.sh index c47a8272a..e6e5d4745 100755 --- a/bin/installto.sh +++ b/bin/installto.sh @@ -52,6 +52,9 @@ if (strtolower($input) == 'y') { if (file_exists("$target_dir/.htaccess")) { $htaccess_copied = copy("$target_dir/.htaccess", "$target_dir/.htaccess.orig"); } + if (file_exists("$target_dir/.user.ini")) { + $user_ini_copied = copy("$target_dir/.user.ini", "$target_dir/.user.ini.orig"); + } $dirs = array('program','installer','bin','SQL','plugins','skins'); if (is_dir(INSTALL_PATH . 'vendor') && !is_file("$target_dir/composer.json")) { @@ -65,7 +68,7 @@ if (strtolower($input) == 'y') { rcube::raise_error("Failed to execute command: $command", false, true); } } - foreach (array('index.php','.htaccess','config/defaults.inc.php','composer.json-dist','jsdeps.json','CHANGELOG','README.md','UPGRADING','LICENSE','INSTALL') as $file) { + foreach (array('index.php','.htaccess','.user.ini','config/defaults.inc.php','composer.json-dist','jsdeps.json','CHANGELOG','README.md','UPGRADING','LICENSE','INSTALL') as $file) { $command = "rsync -a --out-format=%n " . INSTALL_PATH . "$file $target_dir/$file"; if (file_exists(INSTALL_PATH . $file) && (!system($command, $ret) || $ret > 0)) { rcube::raise_error("Failed to execute command: $command", false, true); @@ -86,6 +89,16 @@ if (strtolower($input) == 'y') { } } + // Inform the user about .user.ini change + if (!empty($user_ini_copied)) { + if (file_get_contents("$target_dir/.user.ini") != file_get_contents("$target_dir/.user.ini.orig")) { + echo "\n!! Old .user.ini file saved as .user.ini.orig !!"; + } + else { + @unlink("$target_dir/.user.ini.orig"); + } + } + echo "\n\n"; if (is_dir("$target_dir/skins/default")) {