【问题标题】:Wordpress Error Log not working. The site is experiencing technical difficultiesWordpress 错误日志不起作用。该网站遇到技术难题
【发布时间】:2020-01-07 07:15:41
【问题描述】:

我正在开发自定义 wordpress 插件,我需要显示 php 错误。

// Enable WP_DEBUG mode
define('WP_DEBUG', true);

// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);

// Disable display of errors and warnings 
define('WP_DEBUG_DISPLAY', false);

@ini_set('display_errors',1);

在上面尝试过,但仍然收到此消息:(

The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.

不是错误

【问题讨论】:

  • 请检查您上次添加的代码或插件的删除。它会产生这种类型的错误。也检查您的电子邮件。

标签: php wordpress error-log


【解决方案1】:

您可以通过将WP_DISABLE_FATAL_ERROR_HANDLER 设置为true 来禁用此行为:

define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );

这将阻止“站点遇到技术问题”消息的出现,因此错误将像添加此功能之前一样出现。

【讨论】:

  • 非常感谢..现在我得到了白屏:(
  • 禁用错误显示会使调试更加困难
  • 重新加载 apache 服务如何为我解决了这个问题。
猜你喜欢
  • 1970-01-01
  • 2019-11-24
  • 2021-02-28
  • 2013-08-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-10-06
  • 1970-01-01
相关资源
最近更新 更多