3

我已经升级到 CakePHP 2.5.x 系列,现在正在尝试实现取代 Memcache 的新 Memcached 引擎;但是我得到以下信息:

_cake_core_ 缓存无法将 ' cake_dev_en -us' 写入 Memcached 缓存...

我已经用正确的值更新了 bootstrap.php 和 core.php。Memcached 在我的 Ubuntu 14.04 服务器上使用 localhost (127.0.0.1) 上的端口 11211 正常工作。任何帮助,将不胜感激

谢谢

4

1 回答 1

3

这是因为在 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
));
于 2015-02-11T05:48:47.070 回答