【发布时间】:2017-04-04 16:57:05
【问题描述】:
在yii2我需要使用我已经安装的memcache插件,这也会显示在phpinfo中,但是运行项目时出现以下错误:
无效配置 - yii\base\InvalidConfigException - MemCache 需要加载 PHP memcache 扩展。
缓存配置
'cache' => [
'class' => 'yii\caching\MemCache',
'servers' => [
[
'host' => '127.0.0.1',
'port' => 11211,
'weight' => 60,
],
],
]
【问题讨论】:
-
显示你的缓存配置。
-
'cache' => [ 'class' => 'yii\caching\MemCache', 'servers' => [ [ 'host' => '127.0.0.1', 'port' => 11211, '重量' => 60, ], ], ],
-
您使用的是
Memcache还是Memcached? -
我在我的操作系统(windows 10)上安装了 memcached
-
@AliMoradi :所以卸载它并安装
Memcache。一切正常
标签: php caching yii2 memcached