Yii2异常:ApcCache需要加载PHP apc扩展名 [英] Yii2 Exception: ApcCache requires PHP apc extension to be loaded
本文介绍了Yii2异常:ApcCache需要加载PHP apc扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在高级模板前端的主要配置中配置缓存组件时,在php.ini上启用了扩展名rsults时,我收到异常,我该如何解决此问题? frontend/config/main.php:
I receive the exception when configure the cache components in main configuration of advanced-template frontend, on my php.ini the extension rsults enabled, how I can fix this problem? frontend/config/main.php:
'cache' => [
'class' => 'yii\caching\ApcCache',
'keyPrefix' => 'myapp', // a unique cache key prefix
],
关于apcu的phpinfo()
:
推荐答案
通过如下更新配置来解决:
Solved by updating the configuration as follow:
'cache' => [
'class' => 'yii\caching\ApcCache',
'keyPrefix' => 'myapp', // a unique cache key prefix
'useApcu' => true,
],
php版本是7.0.18,据我所知,该版本仅使用apcu,而不使用像php 5.x这样的apc
The php version is the 7.0.18 and, as I can learn, this version use only apcu and not the apc like php 5.X
这篇关于Yii2异常:ApcCache需要加载PHP apc扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文