|
242 | 242 | unset($output); |
243 | 243 | $v_hostname = $_POST['v_hostname']; |
244 | 244 | } |
245 | | - |
246 | | - // Install/remove php versions |
247 | | - if (empty($_SESSION['error_msg'])) { |
248 | | - if (!empty($v_php_versions)) { |
249 | | - $post_php = $_POST['v_php_versions']; |
250 | | - if(empty($post_php)){ |
251 | | - $post_php = array(); |
252 | | - } |
253 | | - |
254 | | - array_map(function ($php_version) use ($post_php) { |
255 | | - if (array_key_exists($php_version->tpl, $post_php)) { |
256 | | - if (!$php_version->installed) { |
257 | | - exec(HESTIA_CMD . "v-add-web-php " . escapeshellarg($php_version->version), $output, $return_var); |
258 | | - check_return_code($return_var, $output); |
259 | | - unset($output); |
260 | | - if (empty($_SESSION['error_msg'])) { |
261 | | - $php_version->installed = true; |
| 245 | + |
| 246 | + if($_SESSION['WEB_BACKEND'] == "php-fpm"){ |
| 247 | + // Install/remove php versions |
| 248 | + if (empty($_SESSION['error_msg'])) { |
| 249 | + if (!empty($v_php_versions)) { |
| 250 | + $post_php = $_POST['v_php_versions']; |
| 251 | + if(empty($post_php)){ |
| 252 | + $post_php = array(); |
| 253 | + } |
| 254 | + array_map(function ($php_version) use ($post_php) { |
| 255 | + if (array_key_exists($php_version->tpl, $post_php)) { |
| 256 | + if (!$php_version->installed) { |
| 257 | + exec(HESTIA_CMD . "v-add-web-php " . escapeshellarg($php_version->version), $output, $return_var); |
| 258 | + check_return_code($return_var, $output); |
| 259 | + unset($output); |
| 260 | + if (empty($_SESSION['error_msg'])) { |
| 261 | + $php_version->installed = true; |
| 262 | + } |
262 | 263 | } |
263 | | - } |
264 | | - } else { |
265 | | - if ($php_version->installed && !$php_version->protected) { |
266 | | - exec(HESTIA_CMD . "v-delete-web-php " . escapeshellarg($php_version->version), $output, $return_var); |
267 | | - check_return_code($return_var, $output); |
268 | | - unset($output); |
269 | | - if (empty($_SESSION['error_msg'])) { |
270 | | - $php_version->installed = false; |
| 264 | + } else { |
| 265 | + if ($php_version->installed && !$php_version->protected) { |
| 266 | + exec(HESTIA_CMD . "v-delete-web-php " . escapeshellarg($php_version->version), $output, $return_var); |
| 267 | + check_return_code($return_var, $output); |
| 268 | + unset($output); |
| 269 | + if (empty($_SESSION['error_msg'])) { |
| 270 | + $php_version->installed = false; |
| 271 | + } |
271 | 272 | } |
272 | 273 | } |
273 | | - } |
274 | | - |
275 | | - return $php_version; |
276 | | - }, $v_php_versions); |
277 | | - } |
278 | | - } |
279 | 274 |
|
280 | | - if (empty($_SESSION['error_msg'])) { |
281 | | - if($_POST['v_php_default_version'] != DEFAULT_PHP_VERSION) { |
282 | | - exec(HESTIA_CMD . "v-change-sys-php " . escapeshellarg($_POST['v_php_default_version']), $output, $return_var); |
283 | | - check_return_code($return_var, $output); |
284 | | - unset($output); |
285 | | - } |
| 275 | + return $php_version; |
| 276 | + }, $v_php_versions); |
| 277 | + } |
| 278 | + } |
| 279 | + |
| 280 | + if (empty($_SESSION['error_msg'])) { |
| 281 | + if($_POST['v_php_default_version'] != DEFAULT_PHP_VERSION) { |
| 282 | + exec(HESTIA_CMD . "v-change-sys-php " . escapeshellarg($_POST['v_php_default_version']), $output, $return_var); |
| 283 | + check_return_code($return_var, $output); |
| 284 | + unset($output); |
| 285 | + } |
| 286 | + } |
286 | 287 | } |
287 | 288 |
|
288 | 289 | // Change timezone |
|
0 commit comments