Skip to content


memcached windows官网

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

在php.ini 去掉 ‘extension=php_memcache.dll’前的注释
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.