diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 513858ca687065a51e9be208bea37e744fb0cab3..94ffd5703fe0b4bb7e87163027c8dbcecb3fe39f 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -409,80 +409,92 @@ class installer_base {
 
 
 	}
-	
+
+	public function get_host_ips() {
+		$out = array();
+		exec('hostname --all-ip-addresses', $ret, $val);
+		if($val == 0) {
+			if(is_array($ret) && !empty($ret)){
+				$temp = (explode(' ', $ret[0]));
+				foreach($temp as $ip) {
+					$out[] = $ip;
+				}
+			}
+		}
+
+		return $out;
+	}
+
 	public function detect_ips(){
 		global $conf;
+			
+		$output = $this->get_host_ips();
 
-		exec("ip addr show | awk '/global/ { print $2 }' | cut -d '/' -f 1", $output, $retval);
-		
-		if($retval == 0){
-			if(is_array($output) && !empty($output)){
-				foreach($output as $line){
-					$line = trim($line);
-					$ip_type = '';
-					if (filter_var($line, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
-						$ip_type = 'IPv4';
-					}
-					if (filter_var($line, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
-						$ip_type = 'IPv6';
-					}
-					if($ip_type == '') continue;
-					if($this->db->dbHost != $this->dbmaster->dbHost){
-						$this->dbmaster->query('INSERT INTO server_ip (
-							sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
-							sys_perm_other, server_id, client_id, ip_type, ip_address,
-							virtualhost, virtualhost_port
-						) VALUES (
-							1,
-							1,
-							"riud",
-							"riud",
-							"",
-							?,
-							0,
-							?,
-							?,
-							"y",
-							"80,443"
-						)', $conf['server_id'], $ip_type, $line);
-						$server_ip_id = $this->dbmaster->insertID();
-						$this->db->query('INSERT INTO server_ip (
-							server_php_id, sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
-							sys_perm_other, server_id, client_id, ip_type, ip_address,
-							virtualhost, virtualhost_port
-						) VALUES (
-							?,
-							1,
-							1,
-							"riud",
-							"riud",
-							"",
-							?,
-							0,
-							?,
-							?,
-							"y",
-							"80,443"
-						)', $server_ip_id, $conf['server_id'], $ip_type, $line);
-					} else {
-						$this->db->query('INSERT INTO server_ip (
-							sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
-							sys_perm_other, server_id, client_id, ip_type, ip_address,
-							virtualhost, virtualhost_port
-						) VALUES (
-							1,
-							1,
-							"riud",
-							"riud",
-							"",
-							?,
-							0,
-							?,
-							?,
-							"y",
-							"80,443"
-						)', $conf['server_id'], $ip_type, $line);
-					}
+		if(is_array($output) && !empty($output)){
+			foreach($output as $line){
+				$ip_type = '';
+				if (filter_var($line, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
+					$ip_type = 'IPv4';
+				}
+				if (filter_var($line, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
+					$ip_type = 'IPv6';
+				}
+				if($ip_type == '') continue;
+				if($this->db->dbHost != $this->dbmaster->dbHost){
+					$this->dbmaster->query('INSERT INTO server_ip (
+						sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
+						sys_perm_other, server_id, client_id, ip_type, ip_address,
+						virtualhost, virtualhost_port
+					) VALUES (
+						1,
+						1,
+						"riud",
+						"riud",
+						"",
+						?,
+						0,
+						?,
+						?,
+						"y",
+						"80,443"
+					)', $conf['server_id'], $ip_type, $line);
+					$server_ip_id = $this->dbmaster->insertID();
+					$this->db->query('INSERT INTO server_ip (
+						server_php_id, sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
+						sys_perm_other, server_id, client_id, ip_type, ip_address,
+						virtualhost, virtualhost_port
+					) VALUES (
+						?,
+						1,
+						1,
+						"riud",
+						"riud",
+						"",
+						?,
+						0,
+						?,
+						?,
+						"y",
+						"80,443"
+					)', $server_ip_id, $conf['server_id'], $ip_type, $line);
+				} else {
+					$this->db->query('INSERT INTO server_ip (
+						sys_userid, sys_groupid, sys_perm_user, sys_perm_group,
+						sys_perm_other, server_id, client_id, ip_type, ip_address,
+						virtualhost, virtualhost_port
+					) VALUES (
+						1,
+						1,
+						"riud",
+						"riud",
+						"",
+						?,
+						0,
+						?,
+						?,
+						"y",
+						"80,443"
+					)', $conf['server_id'], $ip_type, $line);
 				}
 			}
 		}
@@ -509,15 +521,23 @@ class installer_base {
 
 			//* insert the ispconfig user in the remote server
 			$from_host = $conf['hostname'];
-			$from_ip = gethostbyname($conf['hostname']);
-
 			$hosts[$from_host]['user'] = $conf['mysql']['master_ispconfig_user'];
 			$hosts[$from_host]['db'] = $conf['mysql']['master_database'];
 			$hosts[$from_host]['pwd'] = $conf['mysql']['master_ispconfig_password'];
 
-			$hosts[$from_ip]['user'] = $conf['mysql']['master_ispconfig_user'];
-			$hosts[$from_ip]['db'] = $conf['mysql']['master_database'];
-			$hosts[$from_ip]['pwd'] = $conf['mysql']['master_ispconfig_password'];
+			$host_ips = $this->get_host_ips();
+			if(is_arary($host_ips) && !empty($host_ips)) {
+				foreach($host_ips as $ip) {
+					$hosts[$ip]['user'] = $conf['mysql']['master_ispconfig_user'];
+					$hosts[$ip]['db'] = $conf['mysql']['master_database'];
+					$hosts[$ip]['pwd'] = $conf['mysql']['master_ispconfig_password'];
+				}
+			} else {
+				$from_ip = gethostbyname($conf['hostname']);
+				$hosts[$from_ip]['user'] = $conf['mysql']['master_ispconfig_user'];
+				$hosts[$from_ip]['db'] = $conf['mysql']['master_database'];
+				$hosts[$from_ip]['pwd'] = $conf['mysql']['master_ispconfig_password'];
+			}
 		} else{
 			/*
 			 * it is NOT a master-slave - Setup so we have to find out all clients and their
diff --git a/install/tpl/debian_dovecot2.conf.master b/install/tpl/debian_dovecot2.conf.master
index cfe3bd018297a88206ca6f2a8854cbb26aae7c55..e1929b188dbb4baf1d3e017424eff511bbdaf3f1 100644
--- a/install/tpl/debian_dovecot2.conf.master
+++ b/install/tpl/debian_dovecot2.conf.master
@@ -9,6 +9,7 @@ ssl_cert = </etc/postfix/smtpd.cert
 ssl_key = </etc/postfix/smtpd.key
 ssl_protocols = !SSLv2 !SSLv3
 mail_max_userip_connections = 100
+mail_plugins = $mail_plugins quota
 passdb {
   args = /etc/dovecot/dovecot-sql.conf
   driver = sql
@@ -65,7 +66,6 @@ protocol lmtp {
   mail_plugins = quota sieve
 }
 
-mail_plugins = $mail_plugins quota
 
 #2.3+ service stats {
 #2.3+     unix_listener stats-reader {
diff --git a/interface/web/admin/lib/lang/ar_server_config.lng b/interface/web/admin/lib/lang/ar_server_config.lng
index f271e007d3bc0f89164450e82ae3de3a2c946a12..24a1a419335bc58103cacb942780782f2402427d 100644
--- a/interface/web/admin/lib/lang/ar_server_config.lng
+++ b/interface/web/admin/lib/lang/ar_server_config.lng
@@ -84,7 +84,7 @@ $wb['backup_dir_txt'] = 'Backup directory';
 $wb['named_conf_local_path_txt'] = 'BIND named.conf.local path';
 $wb['php_ini_path_cgi_txt'] = 'CGI php.ini path';
 $wb['php_ini_path_apache_txt'] = 'Apache php.ini path';
-$wb['check_apache_config_txt'] = 'Test apache configuration on restart';
+$wb['check_apache_config_txt'] = 'Test webserver configuration on restart';
 $wb['CA_path_txt'] = 'CA Path';
 $wb['CA_pass_txt'] = 'CA passphrase';
 $wb['ufw_enable_txt'] = 'Enable';
diff --git a/interface/web/admin/lib/lang/bg_server_config.lng b/interface/web/admin/lib/lang/bg_server_config.lng
index 46c77fe794dc79767d0abbe5a745573134ea6598..aa4385b8aedcd46eb693e35c0692b2e470ad9380 100644
--- a/interface/web/admin/lib/lang/bg_server_config.lng
+++ b/interface/web/admin/lib/lang/bg_server_config.lng
@@ -84,7 +84,7 @@ $wb['backup_dir_txt'] = 'Директория за бекъп';
 $wb['named_conf_local_path_txt'] = 'BIND named.conf.local path';
 $wb['php_ini_path_cgi_txt'] = 'CGI php.ini path';
 $wb['php_ini_path_apache_txt'] = 'Apache php.ini path';
-$wb['check_apache_config_txt'] = 'Test apache configuration on restart';
+$wb['check_apache_config_txt'] = 'Test webserver configuration on restart';
 $wb['ufw_enable_txt'] = 'Enable';
 $wb['ufw_manage_builtins_txt'] = 'Manage Builtin Rules';
 $wb['ufw_ipv6_txt'] = 'Enable IPv6';
diff --git a/interface/web/admin/lib/lang/ca_server_config.lng b/interface/web/admin/lib/lang/ca_server_config.lng
index 1dac17eda53b539352fc83bfbfc612fa72ef57fe..40f02fb637dcfa37e48082f0569d0652f2e8aee4 100644
--- a/interface/web/admin/lib/lang/ca_server_config.lng
+++ b/interface/web/admin/lib/lang/ca_server_config.lng
@@ -96,7 +96,7 @@ $wb['backup_dir_txt'] = 'Backup directory';
 $wb['named_conf_local_path_txt'] = 'BIND named.conf.local path';
 $wb['php_ini_path_cgi_txt'] = 'CGI php.ini path';
 $wb['php_ini_path_apache_txt'] = 'Apache php.ini path';
-$wb['check_apache_config_txt'] = 'Test apache configuration on restart';
+$wb['check_apache_config_txt'] = 'Test webserver configuration on restart';
 $wb['network_config_warning_txt'] = 'The network configuration option is only available for Debian and Ubuntu Servers. Do not enable this option if your network interface is not eth0.';
 $wb['CA_path_txt'] = 'CA Path';
 $wb['CA_pass_txt'] = 'CA passphrase';
diff --git a/interface/web/admin/lib/lang/en_server_config.lng b/interface/web/admin/lib/lang/en_server_config.lng
index 1d2bf74ec9c67ff9cfaa89fe629ca310ee53bbb8..b8c9166d43001e02a7091f8fe4078757f5a38447 100644
--- a/interface/web/admin/lib/lang/en_server_config.lng
+++ b/interface/web/admin/lib/lang/en_server_config.lng
@@ -97,7 +97,7 @@ $wb["backup_tmp_txt"] = 'Backup tmp directory for zip';
 $wb["named_conf_local_path_txt"] = 'BIND named.conf.local path';
 $wb["php_ini_path_cgi_txt"] = 'CGI php.ini path';
 $wb["php_ini_path_apache_txt"] = 'Apache php.ini path';
-$wb["check_apache_config_txt"] = 'Test apache configuration on restart';
+$wb["check_apache_config_txt"] = 'Test webserver configuration on restart';
 $wb["network_config_warning_txt"] = 'The network configuration option is only available for Debian and Ubuntu Servers. Do not enable this option if your network interface is not eth0.';
 $wb["CA_path_txt"] = 'CA Path';
 $wb["CA_pass_txt"] = 'CA passphrase';
diff --git a/interface/web/admin/lib/lang/fi_server_config.lng b/interface/web/admin/lib/lang/fi_server_config.lng
index b81f77ac084aaa195f61d5b2bd21d6e115f93515..85b994a72ebe4227609b11546994160dbc33dc95 100755
--- a/interface/web/admin/lib/lang/fi_server_config.lng
+++ b/interface/web/admin/lib/lang/fi_server_config.lng
@@ -84,7 +84,7 @@ $wb['backup_dir_txt'] = 'Backup directory';
 $wb['named_conf_local_path_txt'] = 'BIND named.conf.local path';
 $wb['php_ini_path_cgi_txt'] = 'CGI php.ini path';
 $wb['php_ini_path_apache_txt'] = 'Apache php.ini path';
-$wb['check_apache_config_txt'] = 'Test apache configuration on restart';
+$wb['check_apache_config_txt'] = 'Test webserver configuration on restart';
 $wb['CA_path_txt'] = 'CA Path';
 $wb['CA_pass_txt'] = 'CA passphrase';
 $wb['ufw_enable_txt'] = 'Enable';
diff --git a/interface/web/admin/lib/lang/hu_server_config.lng b/interface/web/admin/lib/lang/hu_server_config.lng
index 0bd058a5bc160ecca27472cd6e265418031effd6..52533a2c78bdf8e25d110e05b37813462bed003c 100644
--- a/interface/web/admin/lib/lang/hu_server_config.lng
+++ b/interface/web/admin/lib/lang/hu_server_config.lng
@@ -84,7 +84,7 @@ $wb['backup_dir_txt'] = 'Mentés könyvtára';
 $wb['named_conf_local_path_txt'] = 'BIND named.conf.local path';
 $wb['php_ini_path_cgi_txt'] = 'CGI php.ini path';
 $wb['php_ini_path_apache_txt'] = 'Apache php.ini path';
-$wb['check_apache_config_txt'] = 'Test apache configuration on restart';
+$wb['check_apache_config_txt'] = 'Test webserver configuration on restart';
 $wb['network_config_warning_txt'] = 'The network configuration option is only available for Debian and Ubuntu Servers. Do not enable this option if your network interface is not eth0.';
 $wb['CA_path_txt'] = 'CA Path';
 $wb['CA_pass_txt'] = 'CA passphrase';
diff --git a/interface/web/admin/lib/lang/ja_server_config.lng b/interface/web/admin/lib/lang/ja_server_config.lng
index 4d1d36250217ee547f6f8ca5224aa030adcd7716..6cd157154a5615ba9f05ff7d1b7d68a4ec1d265f 100644
--- a/interface/web/admin/lib/lang/ja_server_config.lng
+++ b/interface/web/admin/lib/lang/ja_server_config.lng
@@ -84,7 +84,7 @@ $wb['backup_dir_txt'] = 'Backup directory';
 $wb['named_conf_local_path_txt'] = 'BIND named.conf.local path';
 $wb['php_ini_path_cgi_txt'] = 'CGI php.ini path';
 $wb['php_ini_path_apache_txt'] = 'Apache php.ini path';
-$wb['check_apache_config_txt'] = 'Test apache configuration on restart';
+$wb['check_apache_config_txt'] = 'Test webserver configuration on restart';
 $wb['ufw_enable_txt'] = 'Enable';
 $wb['ufw_manage_builtins_txt'] = 'Manage Builtin Rules';
 $wb['ufw_ipv6_txt'] = 'Enable IPv6';
diff --git a/interface/web/admin/lib/lang/pt_server_config.lng b/interface/web/admin/lib/lang/pt_server_config.lng
index 98bf41a283e4bdab1d68b52cf29b246ae5f21df2..fabd1d61cca176499d2b3712dc746f75b746caf1 100644
--- a/interface/web/admin/lib/lang/pt_server_config.lng
+++ b/interface/web/admin/lib/lang/pt_server_config.lng
@@ -84,7 +84,7 @@ $wb['backup_dir_txt'] = 'Backup directory';
 $wb['named_conf_local_path_txt'] = 'BIND named.conf.local path';
 $wb['php_ini_path_cgi_txt'] = 'CGI php.ini path';
 $wb['php_ini_path_apache_txt'] = 'Apache php.ini path';
-$wb['check_apache_config_txt'] = 'Test apache configuration on restart';
+$wb['check_apache_config_txt'] = 'Test webserver configuration on restart';
 $wb['CA_path_txt'] = 'CA Path';
 $wb['CA_pass_txt'] = 'CA passphrase';
 $wb['ufw_enable_txt'] = 'Enable';
diff --git a/interface/web/admin/lib/lang/ro_server_config.lng b/interface/web/admin/lib/lang/ro_server_config.lng
index 27926c44a8192368c22586a014d484a5a4088d74..b5a1a18759e32c00a5732d126790396f9b1dda8e 100644
--- a/interface/web/admin/lib/lang/ro_server_config.lng
+++ b/interface/web/admin/lib/lang/ro_server_config.lng
@@ -84,7 +84,7 @@ $wb['backup_dir_txt'] = 'Backup directory';
 $wb['named_conf_local_path_txt'] = 'BIND named.conf.local path';
 $wb['php_ini_path_cgi_txt'] = 'CGI php.ini path';
 $wb['php_ini_path_apache_txt'] = 'Apache php.ini path';
-$wb['check_apache_config_txt'] = 'Test apache configuration on restart';
+$wb['check_apache_config_txt'] = 'Test webserver configuration on restart';
 $wb['ufw_enable_txt'] = 'Enable';
 $wb['ufw_manage_builtins_txt'] = 'Manage Builtin Rules';
 $wb['ufw_ipv6_txt'] = 'Enable IPv6';
diff --git a/interface/web/admin/lib/lang/se_server_config.lng b/interface/web/admin/lib/lang/se_server_config.lng
index afaac777963face164a734509c2a476cba894e10..92b55336f05a38a718efe21faa713d90958727f3 100644
--- a/interface/web/admin/lib/lang/se_server_config.lng
+++ b/interface/web/admin/lib/lang/se_server_config.lng
@@ -84,7 +84,7 @@ $wb['backup_dir_txt'] = 'Backup directory';
 $wb['named_conf_local_path_txt'] = 'BIND named.conf.local path';
 $wb['php_ini_path_cgi_txt'] = 'CGI php.ini path';
 $wb['php_ini_path_apache_txt'] = 'Apache php.ini path';
-$wb['check_apache_config_txt'] = 'Test apache configuration on restart';
+$wb['check_apache_config_txt'] = 'Test webserver configuration on restart';
 $wb['ufw_enable_txt'] = 'Enable';
 $wb['ufw_manage_builtins_txt'] = 'Manage Builtin Rules';
 $wb['ufw_ipv6_txt'] = 'Enable IPv6';
diff --git a/interface/web/admin/lib/lang/sk_server_config.lng b/interface/web/admin/lib/lang/sk_server_config.lng
index f97bc7f86fd7232c671965414a392bf183d844c9..801a4fece1acc493c17a671e17824dd598928151 100644
--- a/interface/web/admin/lib/lang/sk_server_config.lng
+++ b/interface/web/admin/lib/lang/sk_server_config.lng
@@ -84,7 +84,7 @@ $wb['backup_dir_txt'] = 'Backup directory';
 $wb['named_conf_local_path_txt'] = 'BIND named.conf.local path';
 $wb['php_ini_path_cgi_txt'] = 'CGI php.ini path';
 $wb['php_ini_path_apache_txt'] = 'Apache php.ini path';
-$wb['check_apache_config_txt'] = 'Test apache configuration on restart';
+$wb['check_apache_config_txt'] = 'Test webserver configuration on restart';
 $wb['ufw_enable_txt'] = 'Enable';
 $wb['ufw_manage_builtins_txt'] = 'Manage Builtin Rules';
 $wb['ufw_ipv6_txt'] = 'Enable IPv6';
diff --git a/interface/web/admin/templates/directive_snippets_edit.htm b/interface/web/admin/templates/directive_snippets_edit.htm
index 72eb82369c485c5b6bc44bfe89a0baccfd774b2f..657d0ad1efe1f71594958643c09561df98dbc3b6 100644
--- a/interface/web/admin/templates/directive_snippets_edit.htm
+++ b/interface/web/admin/templates/directive_snippets_edit.htm
@@ -19,7 +19,8 @@
                 <label for="snippet" class="col-sm-3 control-label">{tmpl_var name='snippet_txt'}</label>
                 <tmpl_if name='is_master'><div class="col-sm-9 col-text"><pre>{tmpl_var name='snippet'}</pre></div></tmpl_else><div class="col-sm-9"><textarea class="form-control" name="snippet" id="snippet" rows='10' cols='50'>{tmpl_var name='snippet'}</textarea>
                 &nbsp; Nginx {tmpl_var name='variables_txt'}: <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT}</a>, <a href="javascript:void(0);" class="addPlaceholder">{FASTCGIPASS}</a>, <a href="javascript:void(0);" class="addPlaceholder">{PHPFALLBACKFASTCGIPASS}</a><br />
-				&nbsp; Apache {tmpl_var name='variables_txt'}: <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT}</a>, <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT_CLIENT}</a>
+				&nbsp; Apache {tmpl_var name='variables_txt'}: <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT}</a>, <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT_CLIENT}</a> <br />
+				&nbsp; PHP {tmpl_var name='variables_txt'}: <a href="javascript:void(0);" class="addPlaceholder">{WEBROOT}</a>
 				</div></tmpl_if>
             </div>
             <tmpl_if name='is_master'></tmpl_else>
@@ -81,4 +82,4 @@
         }
     });
 			
-</script>
\ No newline at end of file
+</script>
diff --git a/interface/web/admin/templates/server_config_web_edit.htm b/interface/web/admin/templates/server_config_web_edit.htm
index 97dc0557fcf4f6181d5a63746230d417eed3f98f..05042bac8563c9936caaaf9938f423c7117c6442 100644
--- a/interface/web/admin/templates/server_config_web_edit.htm
+++ b/interface/web/admin/templates/server_config_web_edit.htm
@@ -78,7 +78,7 @@
                         {tmpl_var name='security_level'}
                     </select></div>
             </div>
-            <div class="form-group apache">
+            <div class="form-group">
                 <label class="col-sm-3 control-label">{tmpl_var name='check_apache_config_txt'}</label>
                 <div class="col-sm-9">
                     {tmpl_var name='check_apache_config'}
diff --git a/interface/web/sites/web_vhost_domain_edit.php b/interface/web/sites/web_vhost_domain_edit.php
index 52b44acc79e25c6f25b2c8d0d527e24fb2a61dab..459af39670cfd8f0d823363d6cdc48cb64f64d49 100644
--- a/interface/web/sites/web_vhost_domain_edit.php
+++ b/interface/web/sites/web_vhost_domain_edit.php
@@ -1310,7 +1310,7 @@ class page_action extends tform_actions {
 					// value inside ''
 					if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*\'.*\'\s*;*\s*$@', $custom_php_ini_settings_line)) continue;
 					// everything else
-					if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*[-a-zA-Z0-9~&=_\@/,.#\s\|]*\s*;*\s*$@', $custom_php_ini_settings_line)) continue;
+					if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*[-a-zA-Z0-9~&=_\@/,.#\{\}\s\|]*\s*;*\s*$@', $custom_php_ini_settings_line)) continue;
 					$custom_php_ini_settings_are_valid = false;
 					break;
 				}
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 59e97629cb6d1a2694ce62d2365e62a42c301d8d..08730bee8e5bb8268c553d16d11f68b1877e4b3c 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -3149,6 +3149,7 @@ class apache2_plugin {
 			$custom_php_ini_settings = str_replace("\r", "\n", $custom_php_ini_settings);
 			$ini_settings = explode("\n", $custom_php_ini_settings);
 			if(is_array($ini_settings) && !empty($ini_settings)){
+				$ini_settings = str_replace('{WEBROOT}', $data['new']['document_root'].'/web', $ini_settings);
 				foreach($ini_settings as $ini_setting){
 					$ini_setting = trim($ini_setting);
 					if(substr($ini_setting, 0, 1) == ';') continue;
diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php
index a8a3c3bf16be22f3e737ef8bfb6adf9ef32d2572..a26a96896f6e58a2d6159b2651d41bf1fe3e5506 100644
--- a/server/plugins-available/nginx_plugin.inc.php
+++ b/server/plugins-available/nginx_plugin.inc.php
@@ -2778,6 +2778,7 @@ class nginx_plugin {
 			$custom_php_ini_settings = str_replace("\r", "\n", $custom_php_ini_settings);
 			$ini_settings = explode("\n", $custom_php_ini_settings);
 			if(is_array($ini_settings) && !empty($ini_settings)){
+				$ini_settings = str_replace('{WEBROOT}', $data['new']['document_root'].'/web', $ini_settings);
 				foreach($ini_settings as $ini_setting){
 					$ini_setting = trim($ini_setting);
 					if(substr($ini_setting, 0, 1) == ';') continue;