WordPress.org

Ready to get started?Download WordPress

Forums

PHP Fatal error: Call to a member function get() on a non-object in (9 posts)

  1. melissaaggie98@gmail.com
    Member
    Posted 3 years ago #

    Hello,

    I have been trying to figure out why I am receiving the following PHP Fatal Errors since installing the WP Super Cache plugin. Can anyone please help me with troubleshooting this? Here are the variety of errors I'm seeing:

    PHP Fatal error: Call to a member function get() on a non-object in /home/livmommy/public_html/wp-includes/cache.php on line 93, referer: http://www.mommylivingthelifeofriley.com/2011/05/kids-safe-summer-camp-from-bugs/

    PHP Fatal error: Call to a member function get() on a non-object in /home/livmommy/public_html/wp-includes/cache.php on line 93, referer: http://www.mommylivingthelifeofriley.com/

    I get some more which involve google images searches, which I didn't include here. Does anyone know of a way to fix these from happening? Yesterday, I received 7 of them in one day. Thanks so much for your help!

  2. Donncha O Caoimh
    Member
    Posted 3 years ago #

    I'm pretty sure it's not Supercache causing those errors. They're caused by the fact that PHP destroys PHP objects during shutdown of the current process but code can still execute at that time.

    Some code on your server is running the wp_cache_get() or wp_cache_set() commands during this time. They use the object cache which would have been killed by PHP...

  3. melissaaggie98@gmail.com
    Member
    Posted 3 years ago #

    Thanks so much for your help. So, I would assume that WordPress itself doesn't contain those requests, so I guess it's a plugin that's probably to blame?

    I could search every file of every plugin I use and probably eventually find the "wp_cache_" query, but does anyone know of a faster way to troubleshoot the conflicting plugin? Maybe once I find it, I can find another plugin that does the same job. Thanks again for your help with this!

  4. Donncha O Caoimh
    Member
    Posted 3 years ago #

    If you only have ftp access then it's hard to search but you could try disabling plugins, one at a time, until the errors stop working.

  5. melissaaggie98@gmail.com
    Member
    Posted 3 years ago #

    I have full root access through WHM and cPanel too, but I just don't know how to utilize those to search for one specific phrase. If anyone has any tips on that, I'd love to hear them!

    I would try disabling one plugin at a time, but I only receive about 7 or 8 of these PHP Fatal Errors a day and so I'm afraid that testing would be rather slow going that way.

  6. Navjot Singh
    Member
    Posted 3 years ago #

    I am having the same errors and I searched for "wp_cache_" under all files on my site using grep command but no results returned. I have 4 same fatal errors in my log files. Can't figure out why. Using the latest version of WP Super Cache and WP.

  7. xzistance3
    Member
    Posted 3 years ago #

    I've been having the same errors happen on a client's server to the point where Media Temple thinks it could be significantly affecting the site performance. So, I've had to investigate further.

    All the research I've done seems to point to plugins not properly calling the wp_cache functions. But, all of these errors seem to be happening on line 93, which is attempting to get a cache object. Here is the current 3.2 code for that function:

    function wp_cache_get($id, $flag = '') {
    	global $wp_object_cache;
    	return $wp_object_cache->get($id, $flag);
    }

    My question is.. why doesn't this function check to see if the $wp_object_cache has been set and/or the get() function exists? This seems to be a common error happening among lots of wordpress sites.. couldn't we just update this function to look something like this?

    function wp_cache_get($id, $flag = '') {
    	global $wp_object_cache;
    	if (isset($wp_object_cache)) {
    		return $wp_object_cache->get($id, $flag);
    	}
    }
  8. joesamcoke
    Member
    Posted 3 years ago #

    xzistance3 - have you tried this? Does it work?

    I'm having the same problem in a big way!

  9. Donncha O Caoimh
    Member
    Posted 3 years ago #

    xzistance3 - you'll find this ticket useful, but unfortunately not helpful: http://core.trac.wordpress.org/ticket/15881

Topic Closed

This topic has been closed to new replies.

About this Topic