WordPress.org

Ready to get started?Download WordPress

Forums

Warning: Illegal offset type in wp-includes/cache.php (10 posts)

  1. cyss
    Member
    Posted 7 years ago #

    hi all...

    Im getting this error after upgraded: Warning: Illegal offset type in /home/hkl/public_html/wp-includes/cache.php on line 125

    I've tried around switching to original theme, uploaded the original plugins or disable all plugins but still the same...

    24 similiar errors at the sidebar: http://www.hamkalink.com

    pls advise.. thanks in advance...

  2. marco1971
    Member
    Posted 7 years ago #

    I have the same problem. What do I need to do in order to fix this?

    pls. advise

  3. edelen
    Member
    Posted 7 years ago #

    Having the same problem since upgrading to 2.2...

    Also getting the error in lines 125 and 131. Tried all the classic fixes to no avail. Sometimes flushing the cache works, sometimes not.

  4. TheBell
    Member
    Posted 7 years ago #

    Same here, any solution?

  5. sgharms
    Member
    Posted 7 years ago #

    I just tried it today and have the same error. No fix yet?

  6. Conficio
    Member
    Posted 7 years ago #

    I do have the same error after upgrade from 2.1.2 to 2.2. The cause it that the $id is an empty array, that seems to come from the $GLOBALS['page'].

    PHP 4.3.10 (cli) (built: Mar  9 2005 23:58:04)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
        with Zend Extension Manager v1.0.7, Copyright (c) 2003-2005, by Zend Technologies
        with Zend Optimizer v2.5.10, Copyright (c) 1998-2005, by Zend Technologies

    Here is my backtrace

    [moderated info pasted here http://wordpress.pastebin.ca/523763 ]

    I hope that helps someone to figure out what is happening.

  7. Conficio
    Member
    Posted 7 years ago #

    Solved! It seems to be a Zend optimizer version issue.

    Upgrade to php 4.4.7 and zend optimizer 3.2.8 solved the issue described.

    The old combination php 4.3.10 and Zend Optimizer 2.5.10. did not work.

  8. ricomoorman
    Member
    Posted 7 years ago #

    This really is not solved!

    The problem is not being caused by the Zend optimizer, apache or the PHP whatsoever. It's simply being caused by functions not taking care of what to supply to the WP_Object_Cache->get() method.

    In my case I was just trying to resolve the categories for a given post. Tracking the problem down I found that somehow the function
    "update_post_category_cache()" (functions.php:640) caused the trouble.

    This one is trying to get the category information for each category found for the post (line 667-668).

    It happens under certain circumstances the WP_Object_Cache->get() method is called with an object instead of a string or an integer value as $id to cache.

    My fix was to apply a correct check to the WP_Object_Cache->get() method:

    --- ../wordpress/wp-includes/cache.php.old  2007-07-04 08:03:39.000000000 +0200
    +++ ../wordpress/wp-includes/cache.php  2007-07-04 08:03:06.000000000 +0200
    @@ -122,6 +122,10 @@
            if (empty ($group))
                $group = 'default';
    
    +        if (!is_string($id) || !is_numeric($id)) {
    +            return false;
    +        }
    +
            if (isset ($this->cache[$group][$id])) {
                if ($count_hits)
                    $this->warm_cache_hits += 1;

    BUT I really think this should be fixed within the calling logic too in order to handle this kind of "caching" correctly.

  9. ricomoorman
    Member
    Posted 7 years ago #

    could someone please fix this?! its really a problem out there...

    take a peek!

    http://www.google.com/search?q=Warning+illegal+offset+type+wp-includes%2Fcache.php+on+line

  10. ricomoorman
    Member
    Posted 6 years ago #

    Oh I see this is still not fixed ... the new version of our patch is

    --- ../wordpress/wp-includes/cache.php.old  2007-09-26 08:03:39.000000000 +0200
    +++ ../wordpress/wp-includes/cache.php  2007-09-26 08:03:06.000000000 +0200
    @@ -122,6 +122,10 @@
            if (empty ($group))
                $group = 'default';
    
    +        if (!is_string($id) || !is_numeric($id)) {
    +            return false;
    +        }
    +
            if (isset ($this->cache[$group][$id])) {
                if ($count_hits)
                    $this->warm_cache_hits += 1;

Topic Closed

This topic has been closed to new replies.

About this Topic