仰望星辰工作室

feat: 移除全局默认PHP版本,改为节点级自动检测

Y yang1145 提交于 2026-07-19 08:06 · 07b12d0 ·父提交 c813437
feat: 移除全局默认PHP版本,改为节点级自动检测

- 移除 API 设置页的「默认PHP版本」字段
- 后台开通、外部API开通、插件自动开通统一走节点级PHP版本
- 节点未设置时自动从宝塔API检测最新版本并保存
- 新增「节点PHP管理」管理页面,支持手动设置/自动检测
- MN_bt 表新增 mrbts_php 列
9 个文件变更 +359 -27 13172193298@163.com
•admin/api/setting.php +2 -3
•admin/api/zj.php +22 -1
•api/api.php +23 -1
•app_plugins/hosting_shop/bootstrap.php +49 -0
•app_plugins/hosting_shop/install.sql +4 -1
•app_plugins/hosting_shop/lib/hosting.php +102 -2
•app_plugins/hosting_shop/views/admin/node_php.php +155 -0
•templates/default/admin/add.php +2 -2
•templates/default/admin/set.php +0 -17
变更内容
diff --git a/admin/api/setting.php b/admin/api/setting.php
index 45e095b..2756abe 100644
--- a/admin/api/setting.php
+++ b/admin/api/setting.php
@@ -12,12 +12,11 @@ if($egn=='setwz') {
 if($egn=='setapi') {
 	$apikey=daddslashes($_POST['apikey']);
 	$apiqk=daddslashes($_POST['apiqk']);
-	$php=daddslashes($_POST['php']);
 	$lin=daddslashes($_POST['linux']);
 	$win=daddslashes($_POST['windows']);
 	logjl($user,'API设置','对网站的API设置进行了修改','修改成功',$DB);
-	$sql="update `MN_config` set `api` =?, `apiqk` =?, `hxu` =?, `hxi` =?, `hxo` =? where `id`=?";
-	if($DB->query_prepare($sql,[$apikey,$apiqk,$php,$lin,$win,$siteid]))json_exit('修改成功'); else json_exit('修改失败'.$DB->error());
+	$sql="update `MN_config` set `api` =?, `apiqk` =?, `hxi` =?, `hxo` =? where `id`=?";
+	if($DB->query_prepare($sql,[$apikey,$apiqk,$lin,$win,$siteid]))json_exit('修改成功'); else json_exit('修改失败'.$DB->error());
 	return;
 }
 if($egn=='setkzmb') {
diff --git a/admin/api/zj.php b/admin/api/zj.php
index 8748f0b..615acd8 100644
--- a/admin/api/zj.php
+++ b/admin/api/zj.php
@@ -237,6 +237,27 @@ if($egn=='addzj') {
 	include("./class.php");
 	//实例化对象
 	$api = new bt_api($btipe,$btkeye);
+	// 获取节点默认 PHP 版本(优先节点设置,否则自动检测最新版本)
+	$phpVersion = $cxbt['mrbts_php'] ?? '';
+	if ($phpVersion === '' || $phpVersion === '00') {
+		$phpList = $api->btapi_listphp();
+		if (is_array($phpList)) {
+			$versions = [];
+			foreach ($phpList as $v) {
+				if (($v['status'] ?? false) && ($v['version'] ?? '') !== '00') {
+					$versions[] = $v['version'];
+				}
+			}
+			if (!empty($versions)) {
+				usort($versions, function($a, $b) { return strcmp($b, $a); });
+				$phpVersion = $versions[0];
+				$DB->query_prepare("UPDATE MN_bt SET mrbts_php=? WHERE btdh=? LIMIT 1", [$phpVersion, $btdh]);
+			}
+		}
+	}
+	if ($phpVersion === '' || $phpVersion === '00') {
+		json_exit('错误!无法获取该节点的 PHP 版本,请先在宝塔面板安装 PHP 或在节点管理中设置默认 PHP 版本');
+	}
 	//目录设置
 	$mrwww=$cxbt['btos']=='1' ? $conf['hxi'].'/'.$btserw : $conf['hxo'].'/'.$btserw;
 	if($cptype!='1') {
@@ -245,7 +266,7 @@ if($egn=='addzj') {
 		// 本地查重,BT面板的数据库/FTP重复由webkt接口自行处理并返回错误
 	}
 	//开通网站
-	$r_data = $api->webkt($user,$pass,$btserw,$cp_eh_lx,$cp_eh_ftp,$cp_eh_sql,$conf['hxu'],$mrwww);
+	$r_data = $api->webkt($user,$pass,$btserw,$cp_eh_lx,$cp_eh_ftp,$cp_eh_sql,$phpVersion,$mrwww);
 	$cjqk=$r_data['siteStatus'];
 	//创建情况
 	$zdide=$r_data['siteId'];
diff --git a/api/api.php b/api/api.php
index 9ebf6ed..0cb293d 100644
--- a/api/api.php
+++ b/api/api.php
@@ -59,6 +59,28 @@ if($gn=='cfif'){
     }
     if($cptype=='1'){$cplxch='CDN'; $cp_eh_ftp='false'; $cp_eh_sql='false';}else{$cplxch='主机'; $cp_eh_ftp='true'; $cp_eh_sql='true';}
     $api = new bt_api($btipe,$btkeye);
+    // 获取节点默认 PHP 版本(优先节点设置,否则自动检测最新版本)
+    $phpVersion = $cert['mrbts_php'] ?? '';
+    if ($phpVersion === '' || $phpVersion === '00') {
+        $phpList = $api->btapi_listphp();
+        if (is_array($phpList)) {
+            $versions = [];
+            foreach ($phpList as $v) {
+                if (($v['status'] ?? false) && ($v['version'] ?? '') !== '00') {
+                    $versions[] = $v['version'];
+                }
+            }
+            if (!empty($versions)) {
+                usort($versions, function($a, $b) { return strcmp($b, $a); });
+                $phpVersion = $versions[0];
+                $DB->query_prepare("UPDATE MN_bt SET mrbts_php=? WHERE btdh=? LIMIT 1", [$phpVersion, $bh]);
+            }
+        }
+    }
+    if ($phpVersion === '' || $phpVersion === '00') {
+        api_lifecycle_log('API开通主机','开通'.$user.'失败:无法获取节点PHP版本','开通失败');
+        api_json_exit(100, '错误!无法获取该节点的 PHP 版本,请先在宝塔面板安装 PHP 或联系管理员设置节点默认 PHP 版本');
+    }
     if($cptype!='1'){
         if(mb_strlen($user)<6 || mb_strlen($pass)<6){
             api_lifecycle_log('API开通主机','开通'.$user.'失败:账号或密码过短','开通失败');
@@ -76,7 +98,7 @@ if($gn=='cfif'){
     $wjler=substr($rqsj, $hskr , 3);
     $btserw='mnbt.'.$id.mt_rand(1,999).$wjler;
     $mrwww=$cert['btos']=='1' ? $conf['hxi'].'/'.$btserw : $conf['hxo'].'/'.$btserw;
-    $r_data = $api->webkt($user,$pass,$btserw,$cplxch,$cp_eh_ftp,$cp_eh_sql,$conf['hxu'],$mrwww);
+    $r_data = $api->webkt($user,$pass,$btserw,$cplxch,$cp_eh_ftp,$cp_eh_sql,$phpVersion,$mrwww);
     $cjqk=$r_data['siteStatus'] ?? false;
     $zdide=$r_data['siteId'] ?? 0;
     if($cjqk=='1' || $cjqk=='true' || $cjqk===true){
diff --git a/app_plugins/hosting_shop/bootstrap.php b/app_plugins/hosting_shop/bootstrap.php
index 9a0c200..9707bc5 100644
--- a/app_plugins/hosting_shop/bootstrap.php
+++ b/app_plugins/hosting_shop/bootstrap.php
@@ -242,6 +242,7 @@ mnbt_register_page('admin', 'plans', 'views/admin/plans.php', '套餐管理');
 mnbt_register_page('admin', 'plan_edit', 'views/admin/plan_edit.php', '套餐编辑');
 mnbt_register_page('admin', 'orders', 'views/admin/orders.php', '订单管理');
 mnbt_register_page('admin', 'assets', 'views/admin/assets.php', '资产管理');
+mnbt_register_page('admin', 'node_php', 'views/admin/node_php.php', '节点PHP管理');
 
 // 侧边栏菜单(三级结构)
 mnbt_register_menu('admin', [
@@ -252,5 +253,53 @@ mnbt_register_menu('admin', [
 		['title' => '套餐管理', 'page' => 'plans', 'icon' => 'mdi-package-variant', 'multitabs' => true],
 		['title' => '订单管理', 'page' => 'orders', 'icon' => 'mdi-receipt', 'multitabs' => true],
 		['title' => '资产管理', 'page' => 'assets', 'icon' => 'mdi-server', 'multitabs' => true],
+		['title' => '节点PHP管理', 'page' => 'node_php', 'icon' => 'mdi-language-php', 'multitabs' => true],
 	],
 ]);
+
+/* ============================================================
+ *  管理员端 AJAX:节点 PHP 版本管理
+ * ============================================================ */
+
+// 获取指定节点的 PHP 版本列表(从宝塔 API 实时拉取)
+mnbt_register_ajax('admin', 'p_hosting_node_php_list', function () {
+	mnbt_plugin_require_admin();
+	$btdh = trim((string)($_POST['btdh'] ?? ''));
+	if ($btdh === '') {
+		json_exit_error('请指定节点');
+	}
+	$result = hosting_node_php_list($btdh);
+	if (!$result['ok']) {
+		json_exit_error($result['msg']);
+	}
+	$currentDefault = hosting_node_get_default_php($btdh);
+	json_exit_success('ok', ['versions' => $result['versions'], 'latest' => $result['latest'], 'current_default' => $currentDefault]);
+});
+
+// 自动检测并设置节点的默认 PHP 版本
+mnbt_register_ajax('admin', 'p_hosting_node_php_auto_detect', function () {
+	mnbt_plugin_require_admin();
+	$btdh = trim((string)($_POST['btdh'] ?? ''));
+	if ($btdh === '') {
+		json_exit_error('请指定节点');
+	}
+	$result = hosting_node_auto_detect_php($btdh);
+	if (!$result['ok']) {
+		json_exit_error($result['msg']);
+	}
+	json_exit_success($result['msg'], ['version' => $result['version']]);
+});
+
+// 手动设置节点的默认 PHP 版本
+mnbt_register_ajax('admin', 'p_hosting_node_php_set', function () {
+	mnbt_plugin_require_admin();
+	$btdh = trim((string)($_POST['btdh'] ?? ''));
+	$version = trim((string)($_POST['version'] ?? ''));
+	if ($btdh === '' || $version === '') {
+		json_exit_error('参数不完整');
+	}
+	if (!hosting_node_set_default_php($btdh, $version)) {
+		json_exit_error('保存失败');
+	}
+	json_exit_success('已设置节点 ' . htmlspecialchars($btdh) . ' 的默认 PHP 版本为 ' . $version);
+});
diff --git a/app_plugins/hosting_shop/install.sql b/app_plugins/hosting_shop/install.sql
index 1219166..82a352a 100644
--- a/app_plugins/hosting_shop/install.sql
+++ b/app_plugins/hosting_shop/install.sql
@@ -46,7 +46,7 @@ CREATE TABLE `MN_plugin_hosting_order` (
   KEY `idx_order_no` (`order_no`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
--- 资产表:用户已开通的主机(关联 MN_zj.id)
+-- 资产表
 DROP TABLE IF EXISTS `MN_plugin_hosting_asset`;
 CREATE TABLE `MN_plugin_hosting_asset` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
@@ -62,3 +62,6 @@ CREATE TABLE `MN_plugin_hosting_asset` (
   KEY `idx_user` (`user_id`),
   KEY `idx_host` (`host_id`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- 为 MN_bt 表追加节点默认 PHP 版本列(V1.82 起每个宝塔节点独立管理 PHP 版本)
+ALTER TABLE `MN_bt` ADD COLUMN `mrbts_php` varchar(10) NOT NULL DEFAULT '' AFTER `qk`;
diff --git a/app_plugins/hosting_shop/lib/hosting.php b/app_plugins/hosting_shop/lib/hosting.php
index a61d07f..aa4f80b 100644
--- a/app_plugins/hosting_shop/lib/hosting.php
+++ b/app_plugins/hosting_shop/lib/hosting.php
@@ -318,6 +318,101 @@ function hosting_node_get($btdh)
 	return $DB->get_row_prepare("SELECT * FROM MN_bt WHERE btdh=? LIMIT 1", [$btdh]) ?: null;
 }
 
+/** 获取全部节点列表(管理员端,含完整信息)。 */
+function hosting_node_list_all()
+{
+	global $DB;
+	return $DB->get_all_prepare("SELECT * FROM MN_bt ORDER BY id ASC") ?: [];
+}
+
+/**
+ * 获取节点的默认 PHP 版本。
+ * 优先使用节点自定义的 mrbts_php,为空时自动检测最新版本。
+ */
+function hosting_node_get_default_php($btdh)
+{
+	global $DB;
+	$node = $DB->get_row_prepare("SELECT mrbts_php FROM MN_bt WHERE btdh=? LIMIT 1", [$btdh]);
+	$php = $node['mrbts_php'] ?? '';
+	if ($php !== '' && $php !== '00') {
+		return $php;
+	}
+	// 自动检测最新版本
+	$detected = hosting_node_auto_detect_php($btdh);
+	return $detected['ok'] ? $detected['version'] : '';
+}
+
+/**
+ * 设置节点的默认 PHP 版本。
+ */
+function hosting_node_set_default_php($btdh, $version)
+{
+	global $DB;
+	$version = trim((string)$version);
+	if ($version === '') {
+		return false;
+	}
+	return (bool)$DB->query_prepare(
+		"UPDATE MN_bt SET mrbts_php=? WHERE btdh=? LIMIT 1",
+		[$version, $btdh]
+	);
+}
+
+/**
+ * 从宝塔 API 获取节点可用 PHP 版本列表。
+ * @return array ['ok'=>bool, 'versions'=>array, 'msg'=>string]
+ */
+function hosting_node_php_list($btdh)
+{
+	$node = hosting_node_get($btdh);
+	if (!$node) {
+		return ['ok' => false, 'msg' => '节点不存在'];
+	}
+	$bt_api_file = ROOT . 'MPHX/bt_api.php';
+	if (!is_file($bt_api_file)) {
+		return ['ok' => false, 'msg' => 'bt_api 类文件缺失'];
+	}
+	require_once $bt_api_file;
+
+	$btipe = ($node['ptl'] == 'true' ? 'https' : 'http') . '://' . $node['btip'] . ':' . $node['btdk'];
+	$api = new bt_api($btipe, $node['btmy']);
+	$result = $api->btapi_listphp();
+	if (!is_array($result)) {
+		return ['ok' => false, 'msg' => '无法获取 PHP 版本列表'];
+	}
+	$versions = [];
+	foreach ($result as $v) {
+		if (($v['status'] ?? false) && ($v['version'] ?? '') !== '00') {
+			$versions[] = ['version' => $v['version'], 'name' => $v['name'] ?? ('PHP-' . $v['version'])];
+		}
+	}
+	if (empty($versions)) {
+		return ['ok' => false, 'msg' => '该节点未安装任何 PHP 版本'];
+	}
+	// 按版本号降序排列(最新在前)
+	usort($versions, function ($a, $b) {
+		return strcmp($b['version'], $a['version']);
+	});
+	return ['ok' => true, 'versions' => $versions, 'latest' => $versions[0]['version']];
+}
+
+/**
+ * 自动检测节点最新的 PHP 版本并保存为默认版本。
+ * @return array ['ok'=>bool, 'version'=>string, 'msg'=>string]
+ */
+function hosting_node_auto_detect_php($btdh)
+{
+	$result = hosting_node_php_list($btdh);
+	if (!$result['ok']) {
+		return $result;
+	}
+	$latest = $result['latest'];
+	if (!hosting_node_set_default_php($btdh, $latest)) {
+		return ['ok' => false, 'msg' => '保存默认 PHP 版本失败'];
+	}
+	return ['ok' => true, 'version' => $latest, 'msg' => '已设置默认 PHP 版本为 ' . $latest];
+}
+
 /* ============================================================
  *  订单管理
  * ============================================================ */
@@ -561,7 +656,12 @@ function hosting_open_host($order_id)
 		$cp_eh_ftp = 'true';
 		$cp_eh_sql = 'true';
 	}
-	$mrwww = $node['btos'] == '1' ? $conf['hxu'] : $conf['hxu'];
+	$phpVersion = hosting_node_get_default_php($order['node']);
+	if ($phpVersion === '' || $phpVersion === '00') {
+		hosting_order_set_status($order_id, 'failed', '无法获取节点 PHP 版本');
+		return ['ok' => false, 'msg' => '无法获取该节点的 PHP 版本,请先在宝塔面板安装 PHP 或在节点管理中设置默认 PHP 版本'];
+	}
+	$mrwww = $node['btos'] == '1' ? $phpVersion : $phpVersion;
 	$mrml = ($node['btos'] == '1' ? $conf['hxi'] : $conf['hxo']) . '/' . $btserw;
 
 	// 计算到期时间(支持月/季/半年/年/两年/三年)
@@ -571,7 +671,7 @@ function hosting_open_host($order_id)
 	$datae = date('Y-m-d', $expire_ts);
 
 	// 调用宝塔 API 开通
-	$r_data = $api->webkt($bt_user, $bt_pass, $btserw, $cp_eh_lx, $cp_eh_ftp, $cp_eh_sql, $conf['hxu'], $mrml);
+	$r_data = $api->webkt($bt_user, $bt_pass, $btserw, $cp_eh_lx, $cp_eh_ftp, $cp_eh_sql, $phpVersion, $mrml);
 	$cjqk = $r_data['siteStatus'] ?? false;
 	$zdide = $r_data['siteId'] ?? 0;
 
diff --git a/app_plugins/hosting_shop/views/admin/node_php.php b/app_plugins/hosting_shop/views/admin/node_php.php
new file mode 100644
index 0000000..3f8fb2d
--- /dev/null
+++ b/app_plugins/hosting_shop/views/admin/node_php.php
@@ -0,0 +1,155 @@
+<?php
+/**
+ * 管理员端 - 节点 PHP 版本管理
+ */
+if (!defined('IN_CRONLITE')) {
+	exit;
+}
+
+$nodes = hosting_node_list_all();
+$title = $title ?? '节点PHP管理';
+mnbt_admin_include('head');
+?>
+<div class="container-fluid p-t-15">
+	<div class="card">
+		<div class="card-header">
+			<h4 style="display:inline-block">节点 PHP 版本管理</h4>
+		</div>
+		<div class="card-body">
+			<div class="alert alert-info">
+				<i class="mdi mdi-information"></i> 每个宝塔节点可独立设置默认 PHP 版本。节点未设置时,系统会自动从宝塔 API 检测最新版本。
+			</div>
+
+			<?php if (empty($nodes)): ?>
+				<div class="alert alert-warning">尚未添加任何宝塔节点。</div>
+			<?php else: ?>
+				<div class="table-responsive">
+					<table class="table table-bordered table-hover">
+						<thead class="thead-light">
+							<tr>
+								<th style="width:60px">#</th>
+								<th>节点代号</th>
+								<th style="width:130px">当前默认 PHP</th>
+								<th style="width:130px">操作</th>
+							</tr>
+						</thead>
+						<tbody>
+							<?php foreach ($nodes as $i => $n): ?>
+							<?php $btdh = $n['btdh']; $cur = $n['mrbts_php'] ?? ''; ?>
+							<tr>
+								<td><?= $i + 1 ?></td>
+								<td>
+									<strong><?= htmlspecialchars($btdh) ?></strong>
+									<small class="text-muted d-block"><?= htmlspecialchars($n['btip']) ?>:<?= htmlspecialchars($n['btdk']) ?></small>
+								</td>
+								<td>
+									<span id="php_label_<?= htmlspecialchars($btdh) ?>">
+										<?php if ($cur !== ''): ?>
+											<span class="badge badge-success"><?= htmlspecialchars($cur) ?></span>
+										<?php else: ?>
+											<span class="badge badge-secondary">未设置</span>
+										<?php endif; ?>
+									</span>
+								</td>
+								<td>
+									<button class="btn btn-info btn-sm" onclick="fetchVersions('<?= htmlspecialchars($btdh, ENT_QUOTES) ?>')" id="btn_fetch_<?= htmlspecialchars($btdh) ?>">
+										<i class="mdi mdi-cloud-download"></i> 获取版本
+									</button>
+									<button class="btn btn-success btn-sm" onclick="autoDetect('<?= htmlspecialchars($btdh, ENT_QUOTES) ?>')" id="btn_detect_<?= htmlspecialchars($btdh) ?>">
+										<i class="mdi mdi-magic"></i> 自动设置最新
+									</button>
+								</td>
+							</tr>
+							<?php endforeach; ?>
+						</tbody>
+					</table>
+				</div>
+			<?php endif; ?>
+		</div>
+	</div>
+
+	<!-- 版本选择弹窗 -->
+	<div class="modal fade" id="versionModal" tabindex="-1">
+		<div class="modal-dialog">
+			<div class="modal-content">
+				<div class="modal-header">
+					<h5 class="modal-title">选择 PHP 版本 - <span id="vNodeLabel"></span></h5>
+					<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
+				</div>
+				<div class="modal-body" id="versionList" style="max-height:400px;overflow-y:auto;">
+					<div class="text-center text-muted p-4">加载中...</div>
+				</div>
+				<div class="modal-footer">
+					<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+<script>
+function ajax(gn, data, cb) {
+	$.post('./ajax.php', $.extend({gn: gn}, data), function(res) {
+		try { res = typeof res === 'string' ? JSON.parse(res) : res; } catch(e) {}
+		cb(res);
+	});
+}
+
+function fetchVersions(btdh) {
+	var btn = $('#btn_fetch_' + btdh);
+	btn.prop('disabled', true).html('<i class="mdi mdi-loading mdi-spin"></i> 获取中...');
+	$('#vNodeLabel').text(btdh);
+	$('#versionList').html('<div class="text-center text-muted p-4">加载中...</div>');
+	$('#versionModal').modal('show');
+
+	ajax('p_hosting_node_php_list', {btdh: btdh}, function(res) {
+		btn.prop('disabled', false).html('<i class="mdi mdi-cloud-download"></i> 获取版本');
+		if (res.qk !== 1) {
+			$('#versionList').html('<div class="alert alert-danger">' + (res.msg || res.code || '获取失败') + '</div>');
+			return;
+		}
+		var versions = res.versions || [];
+		var current = res.current_default || '';
+		var html = '';
+		if (versions.length === 0) {
+			html = '<div class="alert alert-warning">该节点未安装任何 PHP 版本</div>';
+		} else {
+			html += '<div class="list-group list-group-flush">';
+			versions.forEach(function(v) {
+				var active = v.version === current ? ' active' : '';
+				var badge = v.version === current ? ' <span class="badge badge-success float-right">当前默认</span>' : '';
+				html += '<a href="javascript:;" class="list-group-item list-group-item-action' + active + '" onclick="setVersion(\'' + btdh + '\', \'' + v.version + '\')">' +
+					'<strong>' + v.version + '</strong> - ' + v.name + badge + '</a>';
+			});
+			html += '</div>';
+		}
+		$('#versionList').html(html);
+	});
+}
+
+function autoDetect(btdh) {
+	var btn = $('#btn_detect_' + btdh);
+	btn.prop('disabled', true).html('<i class="mdi mdi-loading mdi-spin"></i> 检测中...');
+	ajax('p_hosting_node_php_auto_detect', {btdh: btdh}, function(res) {
+		btn.prop('disabled', false).html('<i class="mdi mdi-magic"></i> 自动设置最新');
+		if (res.qk === 1) {
+			$('#php_label_' + btdh).html('<span class="badge badge-success">' + (res.version || '') + '</span>');
+			alert('设置成功:默认 PHP 版本已设为 ' + (res.version || ''));
+		} else {
+			alert(res.msg || res.code || '操作失败');
+		}
+	});
+}
+
+function setVersion(btdh, version) {
+	ajax('p_hosting_node_php_set', {btdh: btdh, version: version}, function(res) {
+		if (res.qk === 1) {
+			$('#php_label_' + btdh).html('<span class="badge badge-success">' + version + '</span>');
+			$('#versionModal').modal('hide');
+			alert('已设置节点 ' + btdh + ' 的默认 PHP 版本为 ' + version);
+		} else {
+			alert(res.msg || res.code || '操作失败');
+		}
+	});
+}
+</script>
diff --git a/templates/default/admin/add.php b/templates/default/admin/add.php
index c1f9a63..1a72e12 100644
--- a/templates/default/admin/add.php
+++ b/templates/default/admin/add.php
@@ -74,7 +74,7 @@ if($set=='bt'){?>
           <button class="btn btn-primary form-control" type="button" onclick="tjbt()"><label><i class="mdi mdi-checkbox-marked-circle-outline"></i></label>确认添加</button>
 
 <h6 class="mt-3">注意:</h6>
-<p>您所对接的宝塔必须安装PHP<?=$conf['hxu']/10?>否则会出现无法创建网站的问题!<br/>推荐添加的宝塔面板版本为7.9.0(包括7.9.0)以上!否则可能会出现错误!我们所使用的测试宝塔也是这个版本!
+<p>您所对接的宝塔必须安装至少一个 PHP 版本,系统会自动检测并使用最新版本!<br/>推荐添加的宝塔面板版本为7.9.0(包括7.9.0)以上!否则可能会出现错误!我们所使用的测试宝塔也是这个版本!
 </p>
 </div>
 
@@ -219,7 +219,7 @@ $bt_list=$DB->get_all_prepare("SELECT * FROM MN_bt order by id desc limit 100");
           <button class="btn btn-primary form-control" type="button" onclick="tjzj()"><label><i class="mdi mdi-checkbox-marked-circle-outline"></i></label>确认添加</button>
 
 <div class="panel-footer">
-<span class="glyphicon glyphicon-info-sign"></span> 注意:<b>您所对接的宝塔必须安装PHP<?=$conf['hxu']/10?>否则会出现创建网站失败的问题!</b><br/>CDN产品由于部分原因导致1台主机只能解析一个域名<br/>到期时间留空即为不启用到期时间(即该主机本系统不会对主机进行到期检测)<br/>最大流量:即该主机每个月最多可用多少流量!每月1日重置,<b>如果不开启流量监控则无法控制流量(开启方法:系统设置->使用教程->系统监控)</b>
+<span class="glyphicon glyphicon-info-sign"></span> 注意:<b>系统会自动检测并使用该节点的最新 PHP 版本,请确保宝塔面板已安装 PHP!</b><br/>CDN产品由于部分原因导致1台主机只能解析一个域名<br/>到期时间留空即为不启用到期时间(即该主机本系统不会对主机进行到期检测)<br/>最大流量:即该主机每个月最多可用多少流量!每月1日重置,<b>如果不开启流量监控则无法控制流量(开启方法:系统设置->使用教程->系统监控)</b>
 </div>
 </div>
 </div>
diff --git a/templates/default/admin/set.php b/templates/default/admin/set.php
index 75c1c0c..dc7922f 100644
--- a/templates/default/admin/set.php
+++ b/templates/default/admin/set.php
@@ -71,23 +71,6 @@ if ($set == 'wz') {
         <div class="input-group-append"><button class="btn btn-outline-secondary" type="button" onclick="apisc()">随机生成</button></div>
       </div>
     </div>
-    <div class="mn-set-field">
-      <label for="mrphp">默认 PHP 版本</label>
-      <select class="form-control" id="mrphp" name="mrphp" size="1">
-        <option value="52" <?php if ($conf['hxu'] == '52') echo 'selected'; ?>>PHP-5.2</option>
-        <option value="53" <?php if ($conf['hxu'] == '53') echo 'selected'; ?>>PHP-5.3</option>
-        <option value="54" <?php if ($conf['hxu'] == '54') echo 'selected'; ?>>PHP-5.4</option>
-        <option value="55" <?php if ($conf['hxu'] == '55') echo 'selected'; ?>>PHP-5.5</option>
-        <option value="56" <?php if ($conf['hxu'] == '56') echo 'selected'; ?>>PHP-5.6</option>
-        <option value="70" <?php if ($conf['hxu'] == '70') echo 'selected'; ?>>PHP-7.0</option>
-        <option value="71" <?php if ($conf['hxu'] == '71') echo 'selected'; ?>>PHP-7.1</option>
-        <option value="72" <?php if ($conf['hxu'] == '72') echo 'selected'; ?>>PHP-7.2</option>
-        <option value="73" <?php if ($conf['hxu'] == '73') echo 'selected'; ?>>PHP-7.3</option>
-        <option value="74" <?php if ($conf['hxu'] == '74') echo 'selected'; ?>>PHP-7.4</option>
-        <option value="80" <?php if ($conf['hxu'] == '80') echo 'selected'; ?>>PHP-8.0</option>
-        <option value="81" <?php if ($conf['hxu'] == '81') echo 'selected'; ?>>PHP-8.1</option>
-      </select>
-    </div>
     <div class="mn-set-field">
       <label for="linuxml">Linux 建站目录</label>
       <input type="text" name="linuxml" id="linuxml" value="<?php echo $conf['hxi']; ?>" class="form-control" placeholder="Linux宝塔面板的建站目录" required/>