thinkphp里面怎样配置memcache

2025-04-15 14:17:31
推荐回答(1个)
回答(1):

THINKPHP 自带memcache 扩展。
这个是配置信息,写到config里面去就行了。
$options = array (
'host' => C('MEMCACHE_HOST') ? C('MEMCACHE_HOST') : '127.0.0.1',
'port' => C('MEMCACHE_PORT') ? C('MEMCACHE_PORT') : 11211,
'timeout' => C('DATA_CACHE_TIMEOUT') ? C('DATA_CACHE_TIMEOUT') : false,
'persistent' => false,
'expire' =>C('DATA_CACHE_TIME'),
'length' =>0,
);