首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫

phpMyAdmin 4.x 訪問緩慢解決方案

     編輯:MySQL 資料庫相關知識

phpMyAdmin 4.x 秒開優化兩招

現象:登入後介面載入極慢、AJAX 請求長時間無回應。根因兩點:本地化時間格式化缺 gettext 支援、官方更新檢查被牆超時。

修復 1:繞過 gettext 時間格式化

編輯 ./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

修復 2:屏蔽在線版本檢查

編輯 ./version_check.php,註釋或刪除以下區塊:

$save = true;
$file = 'https://www.phpmyadmin.net/home_page/version.json';
if (ini_get('allow_url_fopen')) {
    $response = file_get_contents($file);
} else if (function_exists('curl_init')) {
    $curl_handle = curl_init($file);
    curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
    $response = curl_exec($curl_handle);
}

效果驗證

重新登入,介面應秒開,AJAX 回應即時。

補充建議

  • 若仍慢,檢查 php.ini 是否啟用 gettext 擴展
  • 生產環境建議走 HTTPS + 基礎認證雙重防護
  • 定期更新 phpMyAdmin 至最新安全版本
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved