WordPress.org

Ready to get started?Download WordPress

Forums

PHP 5.2 Fatal Error in cache.php (10 posts)

  1. pulponair
    Member
    Posted 7 years ago #

    Hi there,
    after upgrading to PHP 5.2 i recieve
    "PHP Fatal error: Call to a member function get() on a non-object in /var/www/xxx/htdocs/wp-includes/cache.php on line 29"
    This seems to be related to some changes made in php5.2 regarding object handling. See http://www.php.net/UPDATE_5_2.txt and http://www.php.net/ChangeLog-5.php#5.2.0

    Any ideas how to workaround this? Disabling the cache does not work at all.
    Cheers, nikolas

  2. Samuel B
    moderator
    Posted 7 years ago #

    According to a user in another forum you can re-upload the /wp-includes files and it cures it.
    ???

  3. pulponair
    Member
    Posted 7 years ago #

    No, why should that cure this issue?

  4. pulponair
    Member
    Posted 7 years ago #

    Any ideas? on that? anyone out there running wordpress using php 5.2? any other websites i could search?

  5. pulponair
    Member
    Posted 7 years ago #

  6. blork
    Member
    Posted 7 years ago #

    I get the same PHP error, but the fix above didn't help at all, as I'm not good with PHP or MySQL.

    For example, it said:
    Temporary fix :
    wp-includes/cache.php Line 28:
    if (!is_object($wp_object_cache)) {
    $wp_object_cache = new WP_Object_Cache();
    }
    wp-includes/cache.php Line 187:
    if (!is_object($wpdb)) {
    $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
    }

    But it doesn't specify if that code is supposed to REPLACE something that's already there, or if it's supposed to be additional to what's there. I guessed "additional" (given that there was nothing in lines 28 or 187). I re-uploaded the cache.php file, and then the blog would not load at all.

    I'm also tracking this problem over here:

    http://wordpress.org/support/topic/96746

  7. Inspired2Write
    Member
    Posted 7 years ago #

    Good thread to start. I've pondered the idea of upgrading my site to php 5.2 but was concerned if it would goof something up.

    I wonder if it would make any difference to disable the cache setting in the WordPress dashboard before doing the upgrade? I don't know much about php upgrading, but it was just a thought that came to mind.

  8. blork
    Member
    Posted 7 years ago #

    Where do you disable the cache? I looked all over and didn't see anything like that.

    And if I disable the cache, will that just break something else? (I assume the cache is there for a reason...)

  9. blork
    Member
    Posted 7 years ago #

    Whoa! The problem has been SOLVED!

    It was nothing I did -- apparently there IS A PROBLEM WITH WORDPRESS and PHP 5.2! This problem appeared when they upgraded me to PHP 5.2 earlier in the week (I only made the connection a few minutes ago). So my host downgraded me to PHP 4 and now the blog works just fine.

  10. Inspired2Write
    Member
    Posted 7 years ago #

    Hi blork,
    Glad to hear your problem is resolved. In regards to disabling the cache if you need to, it is here:

    Dashboard > Options > WP-Cache

    Then you can select to either disable or enable the cache. Sometimes when I've done changes to my template the only way I could get the change to show up right away was to disable the cache and then later go back in and re-activate it. No harm done by doing so, at least from my understanding. I don't know if maybe the newest version of WordPress eliminated that challenge or not. I haven't tested it since upgrading.

    I don't know if that would have helped or not in regards to upgrading to PHP 5.2 but I think I will hold off on upgrading mine for now until more people report having success with it.

Topic Closed

This topic has been closed to new replies.

About this Topic