日期:2014-05-17  浏览次数:20803 次

windows7 64位机 memcached安装

http://downloads.php.net/pierre/

?

PHP Version 5.3.27

API20090626,NTS,VC9

?

?

1,在终端(也即cmd命令界面)下输入以下命令安装windows服务:

memcached.exe -d install

memcached.exe -d start

2. 把php_memcache.dll放到php的ext目录:

3. 打开 php.ini 文件:extension=php_memcache.dll

?

?

测试代码如下
$memcache = new Memcache;
$memcache->connect("localhost",11211);
echo "Server's version: " . $memcache->getVersion() . "\n";
$tmp_object = new stdClass;
$tmp_object->str_attr = "test";
$tmp_object->int_attr = 123;
$memcache->set("key",$tmp_object,false,10);
echo "Store data in the cache (data will expire in 10 seconds)\n";
echo "Data from the cache:\n";
var_dump($memcache->get("key"));

?