微擎开启redis memcache

时间:2022-01-18 13:10:55

微擎开启redis memcache

2018年01月20日 14:39:54 luogan129 阅读数:2161更多
个人分类: 微信开发
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/luogan129/article/details/79114116

config.php

微擎如何开启memcache

工作随笔  deam  2年前 (2016-08-17)  5319℃  0评论

如何安装memcache,我这边就不说了,网上教程应该一大把。

当服务器已经安装memcache之后,打开微擎的配置文件(./data/config.php):

1、修改 $config[‘setting’][‘cache’]的值为:memcache;

2、增加(如果在配置文件里有这两个,就将其相应的值修改一下):

$config[‘setting’][‘memcache’][‘server’] = ‘127.0.0.1’;//安装有memcache的服务器地址
$config[‘setting’][‘memcache’][‘port’] = ‘11211’;//memcache端口,默认为11211

然后保存后你会发现微擎后台性能优化那边已经显示memcache开启了!



// --------------------------  CONFIG SETTING  --------------------------- //
$config['setting']['charset'] = 'utf-8';
$config['setting']['cache'] = 'redis';
$config['setting']['timezone'] = 'Asia/Shanghai';
  • 1
  • 2
  • 3
  • 4
// --------------------------  CONFIG MEMCACHE  --------------------------- //
$config['setting']['memcache']['server'] = '127.0.0.1';
$config['setting']['memcache']['port'] = 11211;
$config['setting']['memcache']['pconnect'] = 1;
$config['setting']['memcache']['timeout'] = 30;
$config['setting']['memcache']['session'] = 1; // -------------------------- CONFIG REDIS --------------------------- //
$config['setting']['redis']['server'] = '127.0.0.1';//如果redis服务器在别的机器,请填写机器的IP地址。
$config['setting']['redis']['port'] = 6379;
$config['setting']['redis']['pconnect'] = 0;
$config['setting']['redis']['timeout'] = 1;
$config['setting']['redis']['requirepass'] = '';