• I’m unable to select the number of recent posts to show on my main page. There is a cache error on the Options/reading page. It states:

    /wp-includes/cache.php on line 48

    How do I resolve this?
    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • what version of wordpress are you running?

    Whats the specifc error?

    Have you checked your error logs yet?

    Thread Starter chanz

    (@chanz)

    Version WordPress 2.2.1

    Specific error:
    Fatal error: Allowed memory size of 10485760 bytes exhausted (tried to allocate 4734 bytes) in
    …/wp-includes/cache.php on line 48

    Error logs?
    How do I access this?

    Thread Starter chanz

    (@chanz)

    Thank you, whoami.
    I will contact my hosting service (grr… as they are incredibly inutile).
    Wish there was something I could do from my end.

    Thread Starter chanz

    (@chanz)

    Update… my hosting service will not help.

    Anything I can do?

    Turn off plugins or move hosts. I’d lean towards number 2 as your current host just told you that they didn’t want to help you. I like https://synhosting.com myself.

    Hey, I got a solution that worked for me. In order to do that you have to modify a couple of files.

    First, open your config file (wp-config.php), and a line like this;

    define ('DISABLE_CACHE', '1');

    It has to be before the require_once call!

    Generally, this would turn the cache off. However, there are two small bugs that prevent this feature for working. In order to fix them, open your wp-includes/cache.php file. Find the wp_cache_replace and the wp_cache_set functions. Those are the ones that cause the trouble, and that’s because of the serialize|unserialize calls. We have disabled the caching, but nevertheless those functions are not aware of it, because the serialize|unserialize calls are executed before it. So, here’s the patch: add the following line:

    function wp_cache_set($key, $data, $flag = '', $expire = 0) {
    
    	if (defined('DISABLE_CACHE'))
    		return;
    
    	if ( ! defined('ENABLE_CACHE') )
    		return;
    
    	global $wp_object_cache;
    
    	$data = unserialize(serialize($data));
    
    	return $wp_object_cache->set($key, $data, $flag, $expire);
    }

    That’s it. Remember to do this to both functions wp_cache_replace and the wp_cache_set

    Solved!!
    Thanks Mrasnika

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘cache.php error line 48’ is closed to new replies.