[Plugin: APC Object Cache Backend] APC Object Cache plugin – Call to a member function get() on a no
-
Hey Mark, here’s hoping you read the forum threads for your plugin. Seems like there’s an awkward mixup where the tag for the plugin is the same as the tag for APC in general :S
In my error logs I see tons of these fatal errors that clutter it up. No one has complained yet but it makes it impossible to look for other errors.
They seem to be generated when someone opens a google image search result from our site, here’s an example error:
[Fri Mar 04 14:26:33 2011] [error] [client XXX.XXX.XXX.XXX] PHP Fatal error: Call to a member function get() on a non-object in /PATH/TO/WP/wp-content/object-cache.php on line 58, referer: https://www.google.ca/imgres?imgurl=https://globalvoicesonline.org/wp-content/uploads/2008/11/obama.jpg&imgrefurl=https://globalvoicesonline.org/2008/11/08/iran-americans-waited-for-40-years-how-long-should-we-wait/&usg=__CMteVYTP9HPUTYXWOS3Q7WO-FGw=&h=382&w=450&sz=56&hl=en&start=7&zoom=1&um=1&itbs=1&tbnid=44F0ad39Q8MI1M:&tbnh=108&tbnw=127&prev=/images%3Fq%3Diranian%2Bpolitical%2Bcartoons%26um%3D1%26hl%3Den%26tbs%3Disch:1&ei=zjtxTcnKJ9HrOYaNla8O
Admittedly that’s an absurd URL, but the error is pretty serious. Here’s the function being blamed:
function wp_cache_get( $id, $flag = '' ) { return apc_get_cache()->get( $id, $flag ); }
So it seems in some instances the
$wp_object_cache
object, which should be returned by apc_get_cache() isn’t there. I’m still investigating why this happens but it seems that avoiding a fatal error should be possible even if the actual problem isn’t fixed. Maybe if $wp_object_cache isn’t an object, you could die instead of returning it in apc_get_cache()?
- The topic ‘[Plugin: APC Object Cache Backend] APC Object Cache plugin – Call to a member function get() on a no’ is closed to new replies.