ApcCache和Memcache的Cakephp缓存配置
我正在使用CakePHP2.4.6,我想在我的应用程序中使用缓存。 在我的Bootstrap.php中,我发现ApcCache和Memcache的Cakephp缓存配置,cakephp,caching,memcached,apc,Cakephp,Caching,Memcached,Apc,我正在使用CakePHP2.4.6,我想在我的应用程序中使用缓存。 在我的Bootstrap.php中,我发现 Cache::config('default', array('engine' => 'File')); 在我的core.php中,我发现 Cache::config('_cake_core_', array( 'engine' =>
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
));
看完文件后
我已经尝试在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缓存和memcache?
如果需要,请告诉我如何安装Apc i nCakeph不要触摸任何东西。只需更改
$engine='File'代码>到$engine='Apc'代码>位于第352行的core.php。别忘了安装Apc