Support » Fixing WordPress » Unusual PHP error in debug log

  • My clients site has been causing a bit of downtime on the server lately, so i thought I would run a debug and came up with this. And it wont go away.

    PHP Notice: Array to string conversion in /home/xxxxx/public_html/wp-includes/class-requests.php on line 797

    Any help would be appreciated.

    Regards
    D

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there,

    Unless you are familiar with php, you can probably just ignore this. That is, turn off your debugging and you won’t see it. It’s not an error, in the technical sense, but a notice, like it says, that’s meant to signal to the developer that they need to fix their code. A likely candidate for the problem is that a variable is being echoed, something that can be done with a string variable, but not an array variable.

    I have the same error log:
    PHP Notice: Array to string conversion in /home/xxxxxxxxx/public_html/wp-includes/class-requests.php on line 797

    	public static function flatten($array) {
    		$return = array();
    		foreach ($array as $key => $value) {
    			$return[] = sprintf('%s: %s', $key, $value);// this is at line 797
    		}
    		return $return;
    	}
    

    Can someone please help to solve this

    • This reply was modified 2 years, 5 months ago by  milangru.
    • This reply was modified 2 years, 5 months ago by  milangru.

    @milangru, did you solve this issue? Maybe it has something to do with php v.7.x?

    No, just wait to WP core developers fix it 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unusual PHP error in debug log’ is closed to new replies.