zoukankan      html  css  js  c++  java
  • 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------ ";
    print "zhangsan ";
    print "lisi ";
    print "wangwu ";
    print "------get mailq from mailq queue------ ";
    print "first:".$m->get("mailq")." ";
    print "second:".$m->get("mailq")." ";
    print "third:".$m->get("mailq")." ";
    print "fourth:".$m->get("mailq");



  • 相关阅读:
    python入门-函数(二)
    python入门-函数(一)
    python入门-WHILE循环
    python入门-用户输入
    python入门-字典
    Spring Security授权 AccessDecisionManager
    Java的性能优化
    datahub
    vbs mytest
    spring发布和接收定制的事件(spring事件传播)
  • 原文地址:https://www.cnblogs.com/jackluo/p/3922414.html
Copyright © 2011-2022 走看看