3

I have upgraded to CakePHP 2.5.x series and now trying to implement the new Memcached engine that replaces Memcache; however I am getting the following:

_cake_core_ cache was unable to write 'cake_dev_en-us' to Memcached cache in ... Uncaught exception 'CacheException' with message ' is not a valid serializer engine for Memcached'

I have updated bootstrap.php and core.php with the correct values. Memcached is working correctly on my Ubuntu 14.04 server using port 11211 on localhost (127.0.0.1). Any help would be appreciated

Thanks

Pirouet
  • 65
  • 5

1 Answers1

3

This is because in the Config/core.php, the following 'serialize' parameter will be set as false if the cache engine is set as "Memcached", however, MemcachedEngine requires the 'serialize' to be set among 'php','igbinary' and 'json'. You may just comment out the "serialize" line, so 'php' will be the default value.

/**
 * Configure the cache used for general framework caching. Path information,
 * object listings, and translation cache files are stored with this configuration.
 */
Cache::config('_cake_core_', array(
    'engine' => $engine,
    'prefix' => $prefix . 'cake_core_',
    'path' => CACHE . 'persistent' . DS,
    'serialize' => ($engine === 'File'),
    'duration' => $duration
));

/**
 * Configure the cache for model and datasource caches. This cache configuration
 * is used to store schema descriptions, and table listings in connections.
 */
Cache::config('_cake_model_', array(
    'engine' => $engine,
    'prefix' => $prefix . 'cake_model_',
    'path' => CACHE . 'models' . DS,
    'serialize' => ($engine === 'File'),
    'duration' => $duration
));
Xavier Lin
  • 328
  • 2
  • 7