[英]How to properly configure the Apc cache engine?
I'm facing problems when trying to configure Cache
in Cakephp 3. My config is as follows: 尝试在Cakephp 3中配置
Cache
时遇到问题。我的配置如下:
Cache => [
'default' => [
'className' => 'Apc',
'path' => CACHE,
],
'_cake_core_' => [
'className' => 'Apc',
'prefix' => 'mandealR_cake_core_',
'path' => CACHE . 'persistent/',
'serialize' => true,
'duration' => '+2 minutes',
],
'_cake_model_' => [
'className' => 'Apc',
'prefix' => 'mandealR_cake_model_',
'path' => CACHE . 'models/',
'serialize' => true,
'duration' => '+2 minutes',
],
'apc' => [
'engine' => 'Apc'
]
]
I can get 我可以得到
Cache engine Cake\Cache\Engine\ApcEngine is not properly configured.
Can someone help me finding the right config ? 有人可以帮我找到正确的配置吗?
As of CakePHP 3.2, the Apc
cache engine doesn't actually use the APC
extension anymore (which has been definitely discontinued ever since PHP 5.5 shipped with bundled opcode caching), but the APCu
extension. 从CakePHP 3.2开始,
Apc
缓存引擎实际上不再使用APC
扩展了(自PHP 5.5附带捆绑的操作码缓存以来,该APC
扩展肯定已经停止使用),而是APCu
扩展。
http://php.net/manual/en/book.apcu.php http://php.net/manual/zh/book.apcu.php
The migration guide as well as the caching docs seem to lack that information. 迁移指南以及缓存文档似乎缺少该信息。
The error you are receiving generally occours when the extension is not loaded - being it APC
or APCu
( !extension_loaded('apc')
/ !extension_loaded('apcu')
). 未加载扩展名时,通常会出现错误-是
APC
还是APCu
( !extension_loaded('apc')
/ !extension_loaded('apcu')
)。 So make sure that you've configured your PHP installation properly, and that the required extension is installed/loaded. 因此,请确保已正确配置了PHP安装,并且已安装/加载了所需的扩展名。
the Apc
engine doesn't support a path
option. Apc
引擎不支持path
选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.