gpt4 book ai didi

php - Yii2 无效配置 : ApcCache requires PHP apc extension to be loaded

转载 作者:行者123 更新时间:2023-12-04 10:55:10 25 4
gpt4 key购买 nike

我在basic-template的主配置中配置缓存组件时收到异常,我该如何解决这个问题?应用程序/配置/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

最佳答案

您需要安装扩展程序,在 Ubuntu 上您可以执行以下操作:

对于 Ubuntu/Debian

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

对于 CentOS/Fedora
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum install php-pecl-apcu
sudo yum install php-pear php-devel httpd-devel pcre-devel gcc make

以下是如何在 Windows 上安装的指南: http://robert-rusu.blogspot.com/2014/06/install-apcu-on-windows.html

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

关于php - Yii2 无效配置 : ApcCache requires PHP apc extension to be loaded,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59252415/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com