Yii2无效的配置:ApcCache需要加载PHP apc扩展名

问题描述 投票:0回答:1

我在基本模板的主要配置中配置缓存组件时收到异常,如何解决此问题? app / config / web.php:

我的PHP版本是7.1.11

'cache' => [
        'class' => 'yii\caching\ApcCache',
        'keyPrefix' => 'myapp',       // a unique cache key prefix
        'useApcu' => true,
        //'class' => 'yii\caching\MemCache',

],

我尝试使用memCache,但仍然显示相同的错误

enter image description here

php yii2 memcached apc yii2-basic-app
1个回答
0
投票

您需要安装扩展,在Ubuntu上您可以按照以下步骤进行:

sudo apt-get install php-apc
sudo /etc/init.d/apache2 restart

这应该可以解决您的问题。

© www.soinside.com 2019 - 2024. All rights reserved.