Skip to content


windows下安装memcached

memcached官网
http://www.danga.com/memcached/
memcached windows官网
http://jehiah.cz/projects/memcached-win32/

memcached 1.2.0 for Win32为最新版,需libevent 1.2

Unzip the binaries in your desired directory (eg. c:\memcached)
Install the service using the command: ‘c:\memcached\memcached.exe -d install’ from either the command line
Start the server from the Microsoft Management Console or by running the following command: ‘c:\memcached\memcached.exe -d start’
Use the server, by default listening to port 11211
Use ‘memcached.exe -h’ for extra help and command line server

以后memcached将作为windows的一个服务每次开机时自动启动。
在php.ini 去掉 ‘extension=php_memcache.dll’前的注释
下载pecl的memcache模块包到ext目录
NOTE: php和pecl的版本要一致。


connect(‘localhost’, 11211);

/*
set value of item with key ‘var_key’, using on-the-fly compression
expire time is 50 seconds
*/
$memcache_obj->set(‘var_key’, ‘some really big variable’, MEMCACHE_COMPRESSED, 50);

echo $memcache_obj->get(‘var_key’);
?>

显示”some really big variable”就是成功了

Posted in Memcached/redis, 技术.

Tagged with .


No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.