如何使" php扩展丢失"出现错误

时间:2016-04-29 15:21:37

标签: php wordpress

有时候,由于缺少扩展名,我会将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或虚拟主机错误日志中没有跟踪。

我错过了什么?

1 个答案:

答案 0 :(得分:0)

要启用错误报告到您的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...
相关问题