Support » Fixing WordPress » Fatal Error issue

  • I have just logged into my site and automatically upgraded a couple of plugins (my site and I received a message

    Fatal error: Call to undefined method stdClass::set_prefix() in /home/hadfield/public_html/wp-includes/load.php on line 337

    I reviewed this forum to find posts that suggested I reinstall a new WP folders and all files except the wp/content and wp-config file. (heres the link to the post (

    I have used FileZilla to upload but I did not clean install FileZilla.

    I now have a new error message

    Warning: require(/home/hadfield/public_html/wp-includes/class-wp.php) [function.require]: failed to open stream: No such file or directory in /home/hadfield/public_html/wp-settings.php on line 70

    Fatal error: require() [function.require]: Failed opening required ‘/home/hadfield/public_html/wp-includes/class-wp.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/hadfield/public_html/wp-settings.php on line 70

    My website is business related and I really need to reslove this issue ASAP.

    Any help or suggestions warmly recieved.

Viewing 13 replies - 1 through 13 (of 13 total)
  • I have now reinstalled again and included the wp-config file and receive a

    Error establishing a database connection

    message??? I am in need of some serious help.


    I assume you put your database connection details into the wp-config file i.e. database name, username and password?

    did you select prefix table option during installation ?

    I had put the database details in and uploaded. I am now back at square one with the

    Fatal error: Call to undefined method stdClass::set_prefix() in /home/hadfield/public_html/wp-includes/load.php on line 337

    I am not that technical and didnt include/select any prefix tables knowingly. I just selected all the folders and files other than the WP-Content and drag and dropped them in filezila.

    Hope this helps. How can I resolve the above error message it looks like it is something simple in the load php, line 337 simple says.

    $prefix = $wpdb->set_prefix( $table_prefix );

    Not sure what the next step is?? Any suggestions.


    At this stage I would try another reinstall.

    I know you’ve already re-uploaded, but this guy reinstalled again after reinstalling once everything except the wp-content folder and it seemed to work for him –

    Don’t mind me asking, but what version of WordPress are you using?


    OK Ill try it again, I think I was using WP version 3.0.1. Is there anywhere else I can research??

    Also in terms of the upload, do I need to delete then upload or just drop and drag?

    Many thanks


    Drop and Drag should be fine so long as your overwriting what’s there.

    Could try using the latest version of WordPress, 3.2.1. Perhaps the plugin upgrade broke your site because you were using an old version of WordPress, but that’s only a guess.

    I have had this happen at least 5 times and each time it has TRASHED my wordpress site.

    The CULPRIT was the W3Cache Plugin, It had this HUGE invasive features of new upgrade listing in my dashboard and I foolishly allowed it to upgrade.

    It is ridiculous that the only solution seems to be to re-install the whole of wordpress and then create some hybrid of old and new which is bound to create issues.

    WordPress is very good at keeping copies of half edited versions of posts, isn’t it about time it created a backup before it allowed any Plug-in or even itself to update.

    Sure we can go and make backups but is the WordPress platform so untrustworthy that before you dare touch a button you have to think “will this trash my site?”

    I have see these suggestions for repairing this before and they have never worked, I have always had to roll back my site to a backup.

    I thought it might be helpful if we were to examine what got screwed up by upgrading the Plug-in, well this is the code at 337

    337 $prefix = $wpdb->set_prefix( $table_prefix );
    339 if ( is_wp_error( $prefix ) )
    340 wp_die( /*WP_I18N_BAD_PREFIX*/’ERROR: $table_prefix in wp-config.php can only contain numbers, letters, and underscores.’/*/WP_I18N_BAD_PREFIX*/ );
    340 }

    So is WordPress (PHP) bad at reporting the line numbers that caused the error or what?

    Let’s remind ourself of the error

    Fatal error: Call to undefined method stdClass::set_prefix() in /home/username/public_html/ on line 337

    So this is the error “Call to undefined method”

    and this is what is wrong with it “stdClass::set_prefix()”

    So it is basically saying that something is wrong with whatever got put into “set_prefix” and what was put into “set_prefix” came from “$table_prefix”

    So either “$table_prefix” has a bad value or is NULL or has a bad value

    The question is WHAT SCREWED THIS UP, what is it in a W3Cache Plugin Upgrade that trashed the site?

    Ok, I have the same problem with W3 Total Cache. After installing the plugin I get this error:

    Fatal error: Call to undefined method stdClass::set_prefix() in /home/equitas/public_html/wp-includes/load.php on line 337

    I am running WP 3.3 and the version of W3 Total Cache is 9.2.4

    I was able to get my site back up and running just like before the plugin install by deleting (or simply renaming) the following files:


    and deleting the /w3-total-cache folder in wp_content/

    BUT, I still don’t have the W3 Total Cache plugin, which is what I want and need, because my WP site is running as slow as %$@££!!

    This is happening after a server transfer, so I am going to check if in the install on the old server I have the same problem or not.



    I am having the same problem when I tried to update the W3 Total Cache. I get an error message
    Fatal error: Call to undefined method stdClass::set_prefix() in /home/content/67/4581367/html/roseburghomes/wp-includes/load.php on line 337
    I can’t seem to get anywhere. How do I delete the file??
    Any help would be greatly appreciated.




    hi becky
    this error occured when we update plugins ,its all due to conflict of prefix table names, visit these link i hope it will be helpfull to u



    Hi Becky

    OK there are two solutions to this.

    One is to install a brand new WordPress blog (of the same version), then create folder called $dump, then drop the new WPContent folder to that $dump folder. Once completed, drop the WPContent folder from your current blog into this new blog. Then tidy it up and back it up and restore to your usual block (make a copy of the files first just in case)

    Now the best thing to do is avoid the problem in the first place, in my experience the problem has NOTHING to do with prefix tables, it seems that it is that the newer version of W3 Total Cache is not backwardly compatible with some versions of WordPress. So BEFORE you upgrade W3 Total Cache, you need to update your WordPress, but before you do that decativate W3 Total Cache (do not delete it as it leaves road kill on your blog).

    Now before you start make a backup of the WordPress DB and files, I always test these by installing a sub-domain ( and restoring the blog there so I know it works.

    As I write this V3.3 is available and a good speed improvement, when you click on the upgrade link it will try to upgrade the plug-ins, only upgrade those you know work with 3.3, (remember not to upgrade W3 Total Cache until AFTER 3.3 is installed and working).

    So once the other plug-ins have been updated, click on the link to update to V3.3, then once it works, finally, you can install the update to W3 Total Cache.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Fatal Error issue’ is closed to new replies.