简体   繁体   English

如何正确配置Apc缓存引擎?

[英]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 ? 有人可以帮我找到正确的配置吗?

APCu as of CakePHP 3.2 自CakePHP 3.2起的APCu

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. 迁移指南以及缓存文档似乎缺少该信息。

Extension not loaded 扩展未加载

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安装,并且已安装/加载了所需的扩展名。

ps. ps。

the Apc engine doesn't support a path option. Apc引擎不支持path选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM