【发布时间】:2014-04-12 11:04:44
【问题描述】:
我正在使用 Cakephp 2.4.6,我想在我的应用程序中使用缓存。 在我的 Bootstrap.php 中我发现
Cache::config('default', array('engine' => 'File'));
在我的 core.php 中我找到了
Cache::config('_cake_core_', array(
'engine' => $engine,
'prefix' => $prefix . 'cake_core_',
'path' => CACHE . 'persistent' . DS,
'serialize' => ($engine === 'File'),
'duration' => $duration
));
为模型和数据源缓存配置缓存。这个缓存配置 用于存储模式描述和连接中的表列表。
Cache::config('_cake_model_', array(
'engine' => $engine,
'prefix' => $prefix . 'cake_model_',
'path' => CACHE . 'models' . DS,
'serialize' => ($engine === 'File'),
'duration' => $duration
));
看完文档Cakephp Caching¶ 我试图在 Core.php 中配置 Apc Cach
Cache::config('default', array(
'engine' => 'Apc',
'duration'=> 9000,
'probability'=> 100,
'prefix' => Inflector::slug(APP_DIR) . '_',
));
显示错误
Fatal error: Uncaught exception 'CacheException' with message
'Cache engine default is not properly configured.' in C:\xampp\htdocs\go4add\lib\Cake\Cache\Cache.php:181 Stack trace: #0
然后我尝试在 bootstrap.php 中进行配置,效果相同。 请帮帮我..我很困惑..
cakephp中是否需要安装Apc Cache和memcache? 如果需要,请告诉我如何在 nCakeph 中安装 Apc
【问题讨论】:
标签: cakephp caching memcached apc