Skip to content

Commit 631c2d5

Browse files
author
Marius Burkard
committed
Merge branch '6233-fix-socket-path-on-php-7-systems-starts-with-oldest-version' into 'develop'
Resolve "Fix socket path on PHP 7 systems Starts with oldest version" Closes #6233 See merge request ispconfig/ispconfig3!1567
2 parents 2c6534d + f71ffb3 commit 631c2d5

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
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.0-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.0-fpm.sock', $content);
2763-
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);
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.3-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.3-fpm.sock', $content);
2766-
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);
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

server/plugins-available/apps_vhost_plugin.inc.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function update($event_name, $data) {
214214
$content = str_replace('{ssl_comment}', '#', $content);
215215
$content = preg_replace('/(\s)\{ssl_on\}/', '', $content);
216216
}
217-
217+
218218
$content = str_replace('{use_tcp}', $use_tcp, $content);
219219
$content = str_replace('{use_socket}', $use_socket, $content);
220220

@@ -227,11 +227,11 @@ function update($event_name, $data) {
227227
$content = str_replace('{use_rspamd}', $use_rspamd, $content);
228228

229229
// Fix socket path on PHP 7 systems
230-
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);
231-
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);
232-
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);
233-
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);
234230
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);
231+
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);
232+
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);
233+
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);
234+
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);
235235

236236
// PHP-FPM
237237
// Dont just copy over the php-fpm pool template but add some custom settings

0 commit comments

Comments
 (0)