You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

更换Cloudflare域名服务器后phpMyAdmin登录页空白问题求助

Fixing phpMyAdmin Blank Login Page After Enabling Cloudflare

Hey there, I’ve run into similar headaches when pairing Cloudflare with phpMyAdmin—let’s get this sorted out for you!

What’s Causing the Problem?

That error message spells it out clearly: Cloudflare’s Rocket Loader script (rocket-loader.min.js from ajax.cloudflare.com) is getting blocked by phpMyAdmin’s default Content Security Policy (CSP). phpMyAdmin’s default CSP only allows scripts from its own domain, inline scripts, and eval functions, but it doesn’t whitelist Cloudflare’s CDN domain.


Solution 1: Disable Cloudflare’s Rocket Loader (Quickest Fix)

If you don’t depend on Rocket Loader for performance gains, this is the fastest way to fix the issue:

  • Log into your Cloudflare dashboard and select your website’s domain
  • Head to the Speed tab, then navigate to the Optimization section
  • Find the Rocket Loader option and toggle it to Off
  • Wait 2-3 minutes for Cloudflare’s cache to update, then refresh your phpMyAdmin login page. It should load normally now.

Solution 2: Update phpMyAdmin’s CSP to Allow Cloudflare Scripts

If you want to keep Rocket Loader enabled, you’ll need to adjust phpMyAdmin’s CSP rules to whitelist Cloudflare’s domain:

  1. Locate phpMyAdmin’s main configuration file: config.inc.php (this is usually in your phpMyAdmin installation directory, like C:\Apache24\htdocs\phpmyadmin on Windows Server)
  2. Open the file with a text editor and add or modify the following line:
$cfg['ContentSecurityPolicy'] = "script-src 'self' 'unsafe-inline' 'unsafe-eval' ajax.cloudflare.com;";
  1. Save the file and restart your Apache web server on Windows Server (you can do this via the Services console or run net stop Apache2.4 && net start Apache2.4 in Command Prompt)
  2. Refresh phpMyAdmin—you should now see the login page without issues.

Extra Troubleshooting Tips

  • If updating config.inc.php doesn’t work, check your Apache configuration (like .htaccess files or virtual host settings) to make sure there isn’t another CSP rule overriding phpMyAdmin’s setting. Any additional CSP rules must also include ajax.cloudflare.com in the script-src directive.
  • You can also try temporarily disabling Cloudflare’s Auto Minify (under Speed > Optimization) to rule out conflicts with minified scripts.

内容的提问来源于stack exchange,提问作者Ray Yen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 21:07:47