Apcu在webman里边的Cache怎么使用??

anxin

APCU缓存无法使用

/config/cache

return [
    'default' => 'apcu',
    'stores' => [
        'file' => [
            'driver' => 'file',
            'path' => runtime_path('cache')
        ],
        'redis' => [
            'driver' => 'redis',
            'connection' => 'default'
        ],
        'array' => [
            'driver' => 'array'
        ],
        'apcu' => [
            'driver' => 'apcu'
        ]
    ]
];

报错信息

InvalidArgumentException: cache.store.apcu.driver=apcu is not supported. in /www/wwwroot/webman-pay/vendor/webman/cache/src/support/Cache.php:96

截图报错信息里报错文件相关代码

Cache::set();Cache::get(); 正常调用

操作系统及workerman/webman等框架组件具体版本

"workerman/webman-framework": "^2.1",

截图

191 3 0
3个回答

tanhongbin

安装apcu扩展 然后php.ini里面配置好,应该是没有装这个扩展导致的

  • anxin 7天前

    扩展安装了

  • tanhongbin 7天前

    需要配置一下 ini里面得配一下 配置完就可以用了

  • anxin 7天前

    可以了, 需要重启下PHP才生效

阿沁

截图
消失的眼角膜

apcu扩展默认是不在cli模式启动的,要在命令行模式启用需要手动修改配置apc.enable_cli = "1",并且你使用的时候注意,apcu默认的缓存大小是32M,需要的话根据自己的场景修改其大小,详细的你可以去查看php手册

  • 暂无评论
×
🔝