memcached 安装测试
http://www.monkey.org/~provos/libevent/
https://github.com/downloads/libevent/libevent/libevent-2.0.18-stable.tar.gz
http://www.danga.com/memcached/dist/
http://memcached.googlecode.com/files/memcached-1.4.13.tar.gz
wget-r-np-nd--accept=gz--no-check-certificate
-npmeansnoparentdirectory
-ndmeansdon'tconstructlocaldirectorystructure
--accept=gzmeansonlydownload.gzfilesinthedirectory
http://hi.baidu.com/yss1983/blog/item/b875571112904344f819b8c3.html
#tar-xzflibevent-1.1a.tar.gz
#cdlibevent-1.1a
#./configure--prefix=/usr
#make
#makeinstall
#cd..
#tar-xzfmemcached-1.1.12.tar.gz
#cdmemcached-1.1.12
#./configure--prefix=/usr
#make
#makeinstall
/usr/bin/memcached-d-m256-l192.168.1.1-p11211-uwww
/usr/bin/memcached-d-m128-p11211-uwww
参数解释:
-d以守护程序(daemon)方式运行memcached;
-m设置memcached可以使用的内存大小,单位为M;
-l设置监听的IP地址,如果是本机的话,通常可以不设置此参数;
-p设置监听的端口,默认为11211,所以也可以不设置此参数;
-u指定用户,如果当前为root的话,需要使用此参数指定用户
www.cnblogs.com___lstone/articles/890960.html
www.ningoo.net___html/2009/use_memcached_in_php.html
<?php
$memcache=newMemcache;
$memcache->connect('127.0.0.1',11211)ordie("Couldnotconnect");
$version=$memcache->getVersion();
echo"Server'sversion:".$version."\n";
$tmp_object=newstdClass;
$tmp_object->str_attr='test';
$tmp_object->int_attr=123;
$memcache->set('key',$tmp_object,false,10)ordie("Failedtosavedataattheserver");
echo"Storedatainthecache(datawillexpirein10seconds)\n";
$get_result=$memcache->get('key');
echo"Datafromthecache:\n";
var_dump($get_result);
?>