有时我会因为缺少扩展而导致WordPress的白色屏幕死亡。上一次是WordPress AMP插件缺少php.xml扩展。我几乎尝试了我能想到的"一切"来在日志中获得跟踪,例如:
error_reporting(E_ALL);
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
在wp-config.php中。我得到的只是可怕的白色页面。debug.log或虚拟主机错误日志中没有跟踪。
我错过了什么?
要启用对php代码的错误报告,请在脚本顶部附加error_reporting(E_ALL); ini_set('display_errors', '1');
,即:
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
//the rest of the code...