Yii:尽管已安装memcache / memcached,CMemCache仍需要加载PHP memcache扩展

时间:2019-01-31 20:25:10

标签: php nginx yii yii1.x

我已经通过运行sudo apt-get install php-memcached和运行<?php phpinfo(); ?>安装了memcached,结果如下:

enter image description here

但是我的Yii项目仍然存在此错误:

enter image description here

我正在nginx服务器中运行它。

1 个答案:

答案 0 :(得分:2)

memcachememcached是两个单独的扩展名。您需要将useMemcached设置为true才能使用memcached

'cache' => [
    'class' => 'CMemCache',
    'useMemcached' => true,
],

或安装memcache扩展名:

sudo apt install php-memcache
相关问题