WordPress.org

Forums

PHP error in version 3.9.1 (7 posts)

  1. veg-o-matic
    Member
    Posted 1 year ago #

    I started getting this error back in version 3.7.X and despite a couple of upgrades, it won't go away.
    Oddly, it only occurs with two of our 15 blogs, all running on the same machine, all with the same version of WP

    [Wed Jun 04 08:17:15 2014] [error] [client 10.1.7.30] PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in /srv/www/ht
    docs/path/to/blog/wp-includes/update.php on line 270

    Anyone got any ideas? TIA!

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the default theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    - re-uploading all files & folders - except the wp-content folder and wp-config.php & root .htaccess files - from a fresh download of WordPress. Make sure that you delete the old copies of files & folder before uploading the new ones.

  3. lorro
    Member
    Posted 1 year ago #

    Check for non-UTF8 characters in your post text. Candidates include smart/curling inverted commas (replace with the vertical type), the slanted apostrophe (replace with the vertical one) and the longer hyphen favoured by MS Word (replace with the minus sign which is only fractionally shorter).

    Sometimes if you put /feed at the end of the page url, the feed will break giving an error message with the exact point of the invalid character.

  4. veg-o-matic
    Member
    Posted 1 year ago #

    esmi: I have done everything you suggested and I still get the error.

    lorro: the problem doesn't seem to be in a post, but in update.php.

    Still very confused...

  5. lorro
    Member
    Posted 1 year ago #

    Yes, I've had another look. Line 270 is getting an array of plugin data. The plugin data comes from each plugin's primary file which has some comments in the top 20 or so lines, giving Name, PluginURI, Version, Description, Author etc.

    So to identify which plugin it is, rename the plugins folder to say old_plugins. If this removes the error message, create a new empty folder called plugins and move the plugins back one at a time to try and identify the plugin that's causing the problem. Then examine the plugin's primary file comments lines to look for non UTF8 characters.

    Deactivating the plugins is not sufficient for this test.

  6. simanonok
    Member
    Posted 10 months ago #

    lorro, what will 'non UTF8' characters look like? Don't a lot of them LOOK like UTF8's? I really doubt I'd be able to scan every file of a plugin visually and find every one that might be hidden there. I think my old version of Textpad can be set to force saved files into UTF8 format, so do you think I could I load and resave every file for a plugin to get rid of the problem?

  7. simanonok
    Member
    Posted 10 months ago #

    It appears that the problem may trace to the MySQL databases's default character set being latin1 instead of UTF-8. How lovely...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags