Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I stop PHP notices from appearing in wordpress?

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.

like image 218
Carson Myers Avatar asked Aug 20 '09 19:08

Carson Myers


People also ask

How do I turn off php warnings in WordPress?

Turning off PHP Errors in WordPressphp file. ini_set ( 'display_errors' , 'Off' );

How do I turn off php notices?

Method 1: It is the most easy and convenient way to turn off the notices. The notices can be disabled through settings the php. ini file. In the current file, search for the line of code error_reporting.

How do I turn off deprecated warnings in WordPress?

As an interim solution, it is simple to suppress PHP deprecation warnings by disabling WP_DEBUG mode, or (more advanced) by removing E_DEPRECATED from your error_reporting setting.


1 Answers

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

like image 114
Jakub Avatar answered Oct 02 '22 15:10

Jakub