Jelajahi Sumber

Merge pull request #2262 from jaapmarcus/fix/2261-edit-php81-404

Fix #2261 edit php8.1-fpm service not found
Raphael Schneeberger 4 tahun lalu
induk
melakukan
edf18948db
2 mengubah file dengan 10 tambahan dan 2 penghapusan
  1. 9 0
      web/list/server/index.php
  2. 1 2
      web/templates/pages/list_services.html

+ 9 - 0
web/list/server/index.php

@@ -119,6 +119,15 @@ if (isset($_GET['db'])) {
 exec (HESTIA_CMD."v-list-sys-info json", $output, $return_var);
 exec (HESTIA_CMD."v-list-sys-info json", $output, $return_var);
 $sys = json_decode(implode('', $output), true);
 $sys = json_decode(implode('', $output), true);
 unset($output);
 unset($output);
+
+exec (HESTIA_CMD."v-list-sys-php json", $output, $return_var);
+$php = json_decode(implode('', $output), true);
+unset($output);
+$phpfpm = array();
+foreach($php as $version){
+    $phpfpm[] = 'php'.$version.'-fpm';
+}
+
 exec (HESTIA_CMD."v-list-sys-services json", $output, $return_var);
 exec (HESTIA_CMD."v-list-sys-services json", $output, $return_var);
 $data = json_decode(implode('', $output), true);
 $data = json_decode(implode('', $output), true);
 ksort($data);
 ksort($data);

+ 1 - 2
web/templates/pages/list_services.html

@@ -118,8 +118,7 @@
 				$spnd_icon = 'fa-play';
 				$spnd_icon = 'fa-play';
 				$state_icon = 'fa-minus-circle status-icon red';
 				$state_icon = 'fa-minus-circle status-icon red';
 			}
 			}
-
-			if (($key == "php5.6-fpm") || ($key == "php7.0-fpm") || ($key == "php7.1-fpm") || ($key == "php7.2-fpm") || ($key == "php7.3-fpm") || ($key == "php7.4-fpm") || ($key == "php8.0-fpm")) {
+			if(in_array($key, $phpfpm)){
 				$edit_url="php";
 				$edit_url="php";
 			} else {
 			} else {
 				$edit_url=$key;
 				$edit_url=$key;