Forum Moderators: coopster

Message Too Old, No Replies

WP fatal error after updating plugin

getting fatal error

         

Cando

10:35 pm on Dec 5, 2011 (gmt 0)

10+ Year Member



Hello,

I was updating some wp-plugins and now when I refresh my website and/or dashboard I get a blank white page with the following error:

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


Below is line 337
$prefix = $wpdb->set_prefix( $table_prefix );

Can someone please tell me how I can fix this?

Thanks in advance,
Rob

eelixduppy

2:52 pm on Dec 6, 2011 (gmt 0)



>> updating some wp-plugins

Clearly something went wrong in this process. If this is critical, then put the old version of the plugins back until you gather more information about what is wrong with the new version of the plugin you are upgrading to. Otherwise unless someone has had this exact problem before, finding help here is going to be difficult. I would contact whoever has made the plugin, or WordPress support to get additional information; perhaps it is a compatibility issue of some sorts.

londrum

3:17 pm on Dec 6, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



you could probably fix it pretty easy. all it's doing is asking for the prefix that appears before all the wordpress table names. you would have set that yourself, when you installed wordpress.

from memory, i think the default is "wp_", so its probably that (unless you chose something else)

try changing that line to

$prefix = 'wp_';


although that would probably work perfectly okay, its not the best solution because you'd have to amend that line every time you updated wordpress.
it would be better to uninstall each plugin in turn, until you found the one that messed it up.

eelixduppy

5:05 pm on Dec 6, 2011 (gmt 0)



The fact that the method isn't defined in this scope is the issue, not that it can't set the table prefix. If I had to guess, there will be more errors in this file once you "fix" this one; PHP just spits out the first fatal error once it is reached.

Cando

7:16 pm on Dec 6, 2011 (gmt 0)

10+ Year Member



Unfortunately I can no longer access the dashboard nor the website, so any attempts of repair will need to be done from c-panel access.

eelixduppy

7:42 pm on Dec 6, 2011 (gmt 0)



Do you keep regular backups of your website?

eelixduppy

7:47 pm on Dec 6, 2011 (gmt 0)



Also, it would seem that similar people have has this issue in the past. They suggest a possible fix for it: deleting/renaming your .htaccess file, going to the admin panel, and saving changes (to automatically recreate the .htaccess file).

Others didn't have this luck, and instead reverted to a previous backup of their website.

Cando

11:50 pm on Dec 6, 2011 (gmt 0)

10+ Year Member



I tried both renaming and deleting htaccess, plus creating an new htaccess ... none solved the problem.

So I went searching and found a back-up... and installed it, seems to be back to normal so far ...lol

Just so you know the culprit plugin that caused all this was w3-total-cache.0.9.2.4 plugin.

The fatal error may have occurred during WP doing an automatic update, but I think it was directly after I returned to the plugin page as that was the page I saw on my screen when it started... either way I believe updating the plugin is what caused the problem.

@eelixduppy & londrum, thanks for your help!

Rob

eelixduppy

2:11 am on Dec 7, 2011 (gmt 0)



Glad you got things working again :)