Support » Alpha/Beta/RC » Missing class-json.php

  • Resolved Triplanetary


    I updated a site to the latest WP 3.2 nightly, and now the site won’t render. The reason is this:

    <b>Warning</b>:  require_once(/home/content/80/7138980/html//wp-includes/class-json.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>/home/content/80/7138980/html/wp-content/themes/igloo_free/lib_theme/theme_scripts.php</b> on line <b>30</b><br />
    <br />
    <b>Fatal error</b>:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/home/content/80/7138980/html//wp-includes/class-json.php' (include_path='.:/usr/local/php5/lib/php') in <b>/home/content/80/7138980/html/wp-content/themes/igloo_free/lib_theme/theme_scripts.php</b> on line <b>30</b><br />

    So I checked /wp-includes/class-json.php and it’s indeed gone. Has it been renamed or moved? (I don’t think it’s been moved, because I ran a search for it.) Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    It’s definitively gone… Doesn’t show up in trac anymore.

    Try the latest SVN? Maybe you caught a build before it was all cleaned out?

    Well, the require_once call is in one of the files for the site’s theme, not in the WP Core. I’m comfortable altering the particular theme file, but I don’t know if the class-json.php file has been replaced with another one, so I wouldn’t know what to call on.

    Until I figure that one out, all I can do is copy the class-json.php from 3.1.3 back into the wp-includes directory. Which works, as I just discovered. But it bothers me because I have to figure there’s a reason they removed class-json.php.

    Check Ticket 16918 for why class-json.php was removed. It won’t come back now.

    WordPress 3.2 required PHP 5.2.4 or later, class-json.php was included for compatibility with older versions of PHP only. It was removed here:

    Unfortunately, Your theme will need to be updated, you may find that simply commenting out the include line will allow it to continue working if it was using the PHP json functions like any well built theme would have been.

    Alternatively, Copy the json file into your themes folder, and modify the include line to reference the themes folder instead of WordPress’s.

    Thanks, guys. That definitely clears things up.

    I just had the same problem, but the issue was not the theme, it was the TweetThis! plugin. The file was still on my site, it was just in the “wrong” directory. Moving it to where the error message said it was missing from (/public_html/wp-includes/) solved the problem completely.

    Of course if I’d simply updated my plugins before I updated WordPress I never would have had this problem. Duh!

    <who believes in not going into panic mode when something catastrophic happens. At least not until you’ve Googled the problem :-)>

    Thanks Cindy.

    FWIW, here is where I found my Tweet This class-json.php file:
    wp-content > plugins > tweet-this > lib > wp >

    That fixed it for me as well!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Missing class-json.php’ is closed to new replies.