这是因为在 Config/core.php 中,如果缓存引擎设置为“Memcached”,则后面的 'serialize' 参数将设置为 false,但是,MemcachedEngine 要求在 'php' 中设置 'serialize',' igbinary' 和 'json'。您可以只注释掉“serialize”行,因此“php”将是默认值。
/**
* 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
));