php 安装memcacheq
berkeley: http://download.oracle.com/otn/berkeley-db/db-6.1.19.tar.gz?AuthParam=1408431634_4887d44685da5a09c70e30bd7d933861 memcacheq: https://codeload.github.com/stvchu/memcacheq/zip/master
./configure --with-libevent --with-bdb=/usr/local/berkeleydb/ --enable-threads --prefix=/usr/local/memcacheq
/usr/local/memcacheq/bin/memcacheq -h
问题:
/usr/local/memcacheq/bin/memcacheq: error while loading shared libraries: libdb-6.1.so: cannot open shared object file: No such file or directory
解决 :
sudo ln -s /usr/local/berkeleydb/lib/libdb-6.1.so /usr/lib/
ldconfig
sudo /usr/local/memcacheq/bin/memcacheq -d -uwww -r -p11212 -H /data/mcq -N -R -v -L 1024 -B 1024 > /home/wwwlogs/mq_error.log
telnet 127.0.0.1 11212
$memcache_obj = new Memcached; $memcache_obj->addServer(‘127.0.0.1‘,11212); $memcache_obj->set(‘int‘,9); $a = $memcache_obj->get(‘int‘); var_dump($a); $a = $memcache_obj->get(‘int‘); var_dump($a);
result:
[jackluo@localhost mcq]$ php memcacheq.php
int(9)
bool(false)
$m = new Memcached;
$m->addServer("127.0.0.1",11212);
$m->set("mailq","zhangsan");
$m->set("mailq","lisi");
$m->set("mailq","wangwu");
print "------push bellow into mailq queue------\n";
print "zhangsan\n";
print "lisi\n";
print "wangwu\n";
print "------get mailq from mailq queue------\n";
print "first:".$m->get("mailq")."\n";
print "second:".$m->get("mailq")."\n";
print "third:".$m->get("mailq")."\n";
print "fourth:".$m->get("mailq");
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。