php - 如何阻止 PHP 通知出现在 wordpress 中?

标签 php wordpress error-reporting

我知道 error_reporting(0);ini_set('display_errors', false);,但是在 wordpress 中出现了一个通知:

Notice: Array to string conversion in /var/www/vhosts/treethink.net/subdomains/parkridge/httpdocs/wp-includes/formatting.php on line 359

出现在 wordpress 中,而不出现在网站的任何其他页面中。

我检查了 phpinfo(),一切都已设置,因此不会显示错误。为什么这个仍然出现?

这是生成错误的行:

function wp_check_invalid_utf8( $string, $strip = false ) {
    $string = (string) $string;

确实改变了 wordpress 中的一些东西,以改变画廊的工作方式。但不是这个函数,我也不认为我改变了对这个函数的任何调用。除了出现通知外,一切似乎都运行良好,我只需要隐藏此错误即可。

最佳答案

您需要编辑您的:

wp-config.php

在此处归档并修改以下内容:

error_reporting(0);
@ini_set('display_errors', 0);

否则 Wordpress 会覆盖 PHP.INI 设置的 ALERTS

关于php - 如何阻止 PHP 通知出现在 wordpress 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1308379/

相关文章:

php - 使用简码时将 css 添加到 WordPress

php - WordPress 计划事件未在设定时间触发

validation - 标准错误日志文件的良好布局是什么?

PHP 不显示错误 - 内部服务器错误 (500)

php - PHP 比较中的变量位置

php - 了解 PHP/Laravel 中的构造函数、$this 关键字和 Controller 类

c# - PHP/ASP.NET MVC Web-Api 有人知道如何使用PHP通过POST调用WEBAPI

php - 继承和方法参数 PHP

php - 只需要来自 PHP/MySQL 查询的逗号分隔列表

php - mysqli_fetch_assoc()需要参数/调用成员函数bind_param()错误。如何获取并修复实际的mysql错误?