WordPress 白屏/500错误?开启调试模式排查

开启WP_DEBUG

编辑 wp-config.php,将以下内容添加到文件:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

查看错误日志

tail -100 wp-content/debug.log
tail -100 /var/log/nginx/error.log
tail -50 /var/log/php-fpm/error.log

常见原因

  • PHP 内存不足:memory_limit 调整到 256M
  • 插件冲突:重命名 plugins 目录逐一排查
  • 主题问题:通过数据库切换默认主题

发表评论

京ICP备2022034122号