duanjiao5261 2013-02-15 23:05
浏览 169
已采纳

memcached igbinary支持

Below is my phpinfo() output for memcached

memcached

memcached support   enabled
Version 2.1.0
libmemcached version    1.0.4
Session support yes
igbinary support    no
json support    no

I'm using an AWS Linux AMI which is redhat based I believe and uses YUM.

How can I get igbinary support enabled?

Does this have to happen at memcached installation time? I have memcached already working so is there a way I can add this support in now?

thank you

  • 写回答

1条回答 默认 最新

  • dtz8044 2013-02-15 23:22
    关注

    I used to compile the memcached stack manually, which included igbinary. This was before I started using the remi repo, which provides updated packages without all the overhead of manual compilation.

    Here are the notes I used when I used to compile igbinary manually:

    Had to scp the source from another computer due to lack of direct links, the next steps assume pecl/memcached files are local and extracted
    $ -> wget http://pecl.php.net/get/igbinary-1.1.1.tgz
    $ -> tar -xzvf igbinary-1.1.1.tgz
    $ -> cd igbinary-1.1.1
    $ -> phpize
    $ -> ./configure # No need for extra config params
    $ -> make
    $ -> make install # This should copy the resulting .so file to the php dir where all modules are stored
    $ -> /etc/init.d/httpd restart # I remember having to do this for phpinfo to reflect the setting correctly after the udpate
    

    Now, if you view your phpinfo (or php -i from cli) igbinary support should be set to yes.

    -- Update --

    Be sure you have the following line in php.ini or igbinary.ini where php can read it:

    ; Enable igbinary extension module
    extension=igbinary.so
    

    -- Update #2 --

    Forgot to mention, you need to compile memcached with the following flag in order for it to use igbinary:

    --enable-memcached-igbinary
    

    -- Update #3 --

    In case anyone stumbles across this in the future. Manually maintaining the PHP stack along with commonly used extensions is a pain, and usually not worth the extra effort. You are better off using your distro's package manager to handle all the heavy lifting, an example of installing php with memcached with igbinary support would look like:

    yum install php php-cli php-pecl-memcached php-pecl-igbinary
    

    If your distro's upstream version of php is older and you wish to use a newer version, take a look at the REMI repo: http://blog.famillecollet.com/pages/Config-en

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?