【问题标题】:Wordpress: undefined notice error showing but php errors disabled?Wordpress:显示未定义的通知错误但禁用了 php 错误?
【发布时间】:2015-04-02 21:03:03
【问题描述】:

php.ini 文件中,我有 display_errors = offdisplay_startup_errors = off。同样在functions.php 我有error_reporting(0);

wp-config.php 我在顶部 error_reporting(0); @ini_set('display_errors', 0);我也有define('WP_DEBUG', false); define('WP_DEBUG_LOG', false);

仍然显示错误?

我收到了很多 Notice: Undefined variable:Notice: Use of undefined constant 等。我稍后会调试它们,但我能做些什么来隐藏它们?

【问题讨论】:

  • 您可以尝试将此代码放入脚本并使用浏览器运行吗:<?php phpinfo(); ?>
  • 可能会为您的服务器实例加载另一个 INI,而 wordpress 无法覆盖该实例。
  • 通过查看 php.ini 我可以看到本地值,display_errors = on 和主值已关闭。这是否意味着wordpress设置display_errors中可能有文件?
  • 没有。只需分享phpinfo 输出,以便我可以进一步帮助您。

标签: php wordpress


【解决方案1】:

可能会为您的服务器实例加载另一个 INI,而 wordpress 无法覆盖该实例。

您应该在您的 wordpress 安装根目录中查找任何本地 INI 并尝试在那里禁用错误。

有一个有用的答案可以帮助你:https://stackoverflow.com/a/7841902/2004910

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-25
    • 2013-08-12
    • 2011-02-10
    • 1970-01-01
    相关资源
    最近更新 更多