How can I stop PHP notices from appearing in wordpress?

Carson Myers picture Carson Myers · Aug 20, 2009 · Viewed 38.1k times · Source

I know about error_reporting(0);, and ini_set('display_errors', false);, but there is a notice appearing in wordpress:

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

it only appears in wordpress, not in any other pages of the site.

I checked phpinfo(), and everything is set so that errors are not displayed. Why does this one still show up?

Here is the line that generates the error:

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

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.

Answer

Jakub picture Jakub · Aug 20, 2009

You need to edit your:

wp-config.php

file and modify the following here:

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

otherwise Wordpress overwrites the ALERTS set by PHP.INI