微擎开启redis与memcache

/ 1评 / 1

打开/data/config.php

找到:

$config['setting']['cache'] = 'mysql';

// 可改成redis或者memcache,主要看你选用哪种缓存方式

开启memcache需要在服务器安装memcache组件

然后在/data/config.php底部添加如下代码:

// --------------------------  memcache  --------------------------- //
$config['setting']['memcache']['server'] = 'localhost'; //memcache的配置
$config['setting']['memcache']['port'] = 11211;
$config['setting']['memcache']['pconnect'] = 1;
$config['setting']['memcache']['timeout'] = 30;
$config['setting']['memcache']['session'] = 1;
$config['setting']['memcache']['sql'] = 'memcache'; //开启缓存

进入微擎后台,性能优化选项,如果组件安装正确,那么如下图所示:


开启redis需要在服务器安装redis组件,然后在/data/config.php底部添加如下代码:

// --------------------------  redis  --------------------------- //
$config['setting']['redis']['server'] = 'localhost';  //redis的配置
$config['setting']['redis']['port'] = 6379; 
$config['setting']['redis']['pconnect'] = 0; 
$config['setting']['redis']['requirepass'] = ''; 
$config['setting']['redis']['timeout'] = 1;

刷新后台:

 

fr0m:怀化红加博客(https://www.hhseok.com/)

One response to “微擎开启redis与memcache”

  1. 鬼谷先生 says:

    这个技术比较高深,我还没用过。

Leave a Reply

Your email address will not be published. Required fields are marked *