登陆宝塔BT后台,找到左侧,软件管理-你站点对应的php版本,设置-安装扩展-找到redis安装,完成后记得重启下php。
开启性能优化
微擎默认安装后,是没有开启redis的,开启redis的好处是能减少服务器压力;我们需要简单配置下,打开微擎文件data\config.php,注意看一下代码,如果没有就在最后面增加。$config['setting']['redis']['server'] = '127.0.0.1'; //默认本地,你也可以用云库地址(远程)
$config['setting']['redis']['port'] = 6379; //默认端口
$config['setting']['redis']['pconnect'] = 1;
$config['setting']['redis']['auth'] = ''; //redis密码, 默认为空
$config['setting']['redis']['requirepass'] = ''; //redis密码,默认为空,没用人人商城删除这行
$config['setting']['redis']['timeout'] = 1;123456
这样就微擎redis就配置好了,但并没有开启哦,开启详见如下代码,这段你默认就有,注意修改位置$config['setting']['charset'] = 'utf-8';
$config['setting']['cache'] = 'redis'; // 默认是mysql,改为redis
$config['setting']['timezone'] = 'Asia/Shanghai';
$config['setting']['memory_limit'] = '256M';
$config['setting']['filemode'] = 0644;
$config['setting']['authkey'] = 'fa6f7528';
$config['setting']['founder'] = '1';
$config['setting']['development'] = 0;
$config['setting']['referrer'] = 0;
$config['setting']['https'] = 1;
12345678910
注意第二行,mysql修改为redis就开启缓存了,你可以登陆后台,在站点-性能优化里看到redis已开启。