下面是memcached的phpinfo()输出
memcached
memcached support enabled
Version 2.1.0
libmemcached version 1.0.4
Session support yes
igbinary support no
json support no我使用的是AWS Linux AMI,我相信它是基于redhat的,并且使用YUM。
如何启用igbinary支持?
这一定要在memcached安装时发生吗?我已经有了memcached,所以现在有没有办法添加这个支持呢?
谢谢
发布于 2013-02-16 07:22:01
我过去常常手动编译memcached堆栈,其中包含igbinary。那是在我开始使用remi repo之前,它提供了更新的包,而没有所有手动编译的开销。
以下是我在手动编译igbinary时使用的注释:
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现在,如果你查看你的phpinfo (或者来自cli的php -i ),igbinary support应该设置为yes。
-更新--
请确保您在php.ini或igbinary.ini中有以下行,php可以读取它:
; Enable igbinary extension module
extension=igbinary.so更新#2 --
忘记提到,您需要使用以下标志编译memcached才能使用igbinary:
--enable-memcached-igbinary更新#3 --
以防将来有人偶然发现这一点。手动维护PHP堆栈和常用扩展是一件痛苦的事情,而且通常不值得付出额外的努力。你最好使用发行版的包管理器来处理所有繁重的工作,下面是一个安装php与memcached并支持igbinary的示例:
yum install php php-cli php-pecl-memcached php-pecl-igbinary如果您的发行版的php上游版本较旧,而您希望使用较新的版本,请查看REMI repo:http://blog.famillecollet.com/pages/Config-en
https://stackoverflow.com/questions/14904865
复制相似问题