慢日志顯示:
[pool www] pid 10992 script_filename = /phpmyadmin/version_check.php
file_get_contents() version_check.php:240
原因:phpMyAdmin 定期請求 https://www.phpmyadmin.net/home_page/version.json 檢查更新,國內訪問極慢/超時。
# 編輯 version_check.php
# 在
# 編輯 libraries/config.default.php
# 找到
$cfg['LoginCookieValidity'] = 1440;
# 修改為 (單位:秒)
$cfg['LoginCookieValidity'] = 86400; // 1天
$cfg['LoginCookieValidity'] = 604800; // 1周
$cfg['LoginCookieStore'] = 1; // 持久化 Cookie
# 編輯 libraries/Util.class.php
# 找到
return strftime($date, $timestamp);
# 替換為
if (extension_loaded('gettext')) {
return strftime($date, $timestamp);
}
date_default_timezone_set('UTC');
return gmdate('Y-m-d H:i:s', $timestamp + 28800); // 中國區 UTC+8
| 文件 | 配置項 | 默認值 | 建議值 | 作用 |
|---|---|---|---|---|
| version_check.php | - | 啟用檢查 | exit/註釋 | 禁用緩慢更新檢查 |
| config.default.php | LoginCookieValidity | 1440 | 86400 | 登錄有效期 |
| config.default.php | LoginCookieStore | 0 | 1 | 持久化 Cookie |
| Util.class.php | strftime 邏輯 | 依賴 gettext | gmdate 替代 | 避免無 gettext 環境報錯 |