memcached

http://www.cnblogs.com/jeffwongishandsome/archive/2011/11/06/2238265.html 常用命令

安装:

wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz

wget https://memcached.googlecode.com/files/memcached-1.4.15.tar.gz

安装 memcached 需要先安装 libevent,两个安装教程都是标准的 ./configure && make && make install ,安装好之后,使用命令 memcached -d -m 128 -l localhost -p 11211 -u root 即可启动 memcached 服务。

<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<body>
<?php
	$mem = new Memcache();
	$mem->addserver("211.152.52.106", 11211);
	$mem->set("mykey", "This is a test cache!", 0, 60);
	$val = $mem->get("mykey");
	echo $val;
?>
</body>
</html>

  

posted @ 2013-11-01 10:38  丫呀雅押  阅读(222)  评论(0编辑  收藏  举报