Skip to content

Commit b5b8626

Browse files
author
Till Brehm
committed
Fixed: FS#3504 - Switching between FastCGI and any other and VHost website issue
1 parent 02797b7 commit b5b8626

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,18 +1205,15 @@ function update($event_name, $data) {
12051205

12061206
} else {
12071207
//remove the php fastgi starter script if available
1208+
$fastcgi_starter_script = $fastcgi_config['fastcgi_starter_script'].($data['old']['type'] == 'vhostsubdomain' ? '_web' . $data['old']['domain_id'] : '');
12081209
if ($data['old']['php'] == 'fast-cgi') {
12091210
$fastcgi_starter_path = str_replace('[system_user]', $data['old']['system_user'], $fastcgi_config['fastcgi_starter_path']);
12101211
$fastcgi_starter_path = str_replace('[client_id]', $client_id, $fastcgi_starter_path);
12111212
if($data['old']['type'] == 'vhost') {
1212-
if (is_dir($fastcgi_starter_path)) {
1213-
exec('rm -rf '.$fastcgi_starter_path);
1214-
}
1213+
if(is_file($fastcgi_starter_script)) @unlink($fastcgi_starter_script);
1214+
if (is_dir($fastcgi_starter_path)) @rmdir($fastcgi_starter_path);
12151215
} else {
1216-
$fcgi_starter_script = $fastcgi_starter_path.$fastcgi_config['fastcgi_starter_script'].'_web' . $data['old']['domain_id'];
1217-
if (file_exists($fcgi_starter_script)) {
1218-
exec('rm -f '.$fcgi_starter_script);
1219-
}
1216+
if(is_file($fastcgi_starter_script)) @unlink($fastcgi_starter_script);
12201217
}
12211218
}
12221219
}

0 commit comments

Comments
 (0)