Skip to content

Commit f71ffb3

Browse files
author
System Administrator
committed
Use elseif instead of if (#6233)
1 parent de956eb commit f71ffb3

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

install/lib/installer_base.lib.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,11 +2759,17 @@ public function configure_apps_vhost() {
27592759
$content = str_replace('{use_socket}', $use_socket, $content);
27602760

27612761
// Fix socket path on PHP 7 systems
2762-
if(file_exists('/var/run/php/php7.4-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.4-fpm.sock', $content);
2763-
if(file_exists('/var/run/php/php7.3-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.3-fpm.sock', $content);
2764-
if(file_exists('/var/run/php/php7.2-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.2-fpm.sock', $content);
2765-
if(file_exists('/var/run/php/php7.1-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.1-fpm.sock', $content);
2766-
if(file_exists('/var/run/php/php7.0-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.0-fpm.sock', $content);
2762+
if (file_exists('/var/run/php/php7.4-fpm.sock')) {
2763+
$content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.4-fpm.sock', $content);
2764+
} elseif(file_exists('/var/run/php/php7.3-fpm.sock')) {
2765+
$content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.3-fpm.sock', $content);
2766+
} elseif (file_exists('/var/run/php/php7.2-fpm.sock')) {
2767+
$content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.2-fpm.sock', $content);
2768+
} elseif (file_exists('/var/run/php/php7.1-fpm.sock')) {
2769+
$content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.1-fpm.sock', $content);
2770+
} elseif (file_exists('/var/run/php/php7.0-fpm.sock')) {
2771+
$content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.0-fpm.sock', $content);
2772+
}
27672773

27682774
wf($vhost_conf_dir.'/apps.vhost', $content);
27692775

0 commit comments

Comments
 (0)