首先第一步需要安装memcached扩展

安装方法这里就不叙述了

application/config/memcached.php配置

$config = array(
'default' => array(
'hostname' => '127.0.0.1',
'port' => '10000',
'weight' => '1',
),
);
开启memcached 端口10000
使用:
$this->load->driver('cache');

$this->cache->memcached->save('test','test',300);

$this->cache->memcached->get('test');
ci框架手册
https://codeigniter.org.cn/user_guide/libraries/caching.html#memcached
posted on 2017-09-05 10:49  程序小院  阅读(206)  评论(0编辑  收藏  举报