APC Object Cache Backend
APC Object Cache plugin - Call to a member function get() on a no (2 posts)

  1. Jeremy Clarke
    Posted 5 years ago #

    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: http://www.google.ca/imgres?imgurl=http://globalvoicesonline.org/wp-content/uploads/2008/11/obama.jpg&imgrefurl=http://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()?

  2. ds123
    Posted 5 years ago #

    @jeremyclarke is it safe to use this plugin on APC Version 3.0.19
    PHP Version 5.2.6 ...wordpress 3 (not 3.1)

    i just had my site crash using ryan's memcached plugin so am hoping until i can sort that out that i can use this one to at least get apc caching

    any advice would be greatly appreciated!

    this is the error i believe that eventually crashed the site but not sure all i know is that when i removed object-cache.php file my site came back up....PHP Fatal error: Call to a member function get() on a non-object in /home/mydomain.com/web/public/wp-content/object-cache.php on line 53, referer: http://mydomain/members/tegrass/?new
    zend_mm_heap corrupted

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • APC Object Cache Backend
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic