如何阻止PHP通知出现在wordpress中? [英] How can I stop PHP notices from appearing in wordpress?
问题描述
我知道error_reporting(0);
和ini_set('display_errors', false);
,但是在wordpress中出现了一个提示:
I know about error_reporting(0);
, and ini_set('display_errors', false);
, but there is a notice appearing in wordpress:
注意: 359 行上的/var/www/vhosts/treethink.net/subdomains/parkridge/httpdocs/wp-includes/formatting.php 中的数组到字符串的转换>
Notice: Array to string conversion in /var/www/vhosts/treethink.net/subdomains/parkridge/httpdocs/wp-includes/formatting.php on line 359
仅 出现在wordpress中,而不出现在网站的其他页面中.
it only appears in wordpress, not in any other pages of the site.
我检查了phpinfo()
,并设置了所有内容,以便不显示错误.为什么这个仍然出现?
I checked phpinfo()
, and everything is set so that errors are not displayed. Why does this one still show up?
以下是生成错误的行:
function wp_check_invalid_utf8( $string, $strip = false ) {
$string = (string) $string;
我做了在wordpress中进行了一些更改,以更改画廊的工作方式.但是没有这个函数,我也不认为我也改变了对该函数的任何调用.除了出现通知以外,一切似乎都可以正常运行,我只需要隐藏此错误即可.
I did change some thing in wordpress, to change how the gallery worked. But not this function, and I don't think I changed any calls to this function either. Aside from the notice appearing, everything seems to operate perfectly fine, I just need to get this error to hide.
推荐答案
您需要
wp-config.php
在此处归档并修改以下内容:
file and modify the following here:
error_reporting(0);
@ini_set('display_errors', 0);
否则,WordPress会覆盖PHP.INI设置的警报
otherwise Wordpress overwrites the ALERTS set by PHP.INI
这篇关于如何阻止PHP通知出现在wordpress中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!