2013-02-15 137 views
1

下面是我的phpinfo()memcached的memcached的igbinary支持

memcached 

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

輸出我使用的是Linux的AWS AMI這是紅帽基於我相信並使用YUM。

如何啓用igbinary支持?

這是否發生在memcached安裝時?我有memcached已經工作,所以現在有一種方法可以添加此支持嗎?

謝謝

+0

這是更多的問題:http://serverfault.com/這裏的用戶更多的是編程,所以你有一個更好的變化,以獲得答案在那裏。 – 2013-02-15 23:21:44

回答

4

我曾經手動編譯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 

現在,如果你(從CLI或php -i)查看您的phpinfo igbinary支持應設置爲yes。

- 更新 -

要確保你有在php.ini以下行或igbinary.ini PHP在哪裏可以讀取它:

; Enable igbinary extension module 
extension=igbinary.so 

- 更新#2 -

忘了提,你需要編譯如下標誌的memcached,以便它使用igbinary:

--enable-memcached-igbinary 

- Update#3 -

如果有人在將來遇到這種情況。手工維護PHP堆棧以及常用的擴展是一件痛苦的事,通常不值得花費額外的努力。你最好使用你的發行版的軟件包管理器來處理所有繁重的任務,與igbinary支持memcached的安裝PHP會是什麼樣子的例子:

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

如果你的發行版的PHP的上游版本是舊的,你想使用更新的版本,看看REMI回購:http://blog.famillecollet.com/pages/Config-en

+0

thx。我按照上面的步驟完成了安裝。我還添加了以下內容到php.ini,我可以在phpinfo()中看到關於igbinary的更多信息,但問題中的設置仍然沒有... hummmm – Adam 2013-02-16 00:10:12

+0

;負載igbinary擴展 extension = igbinary.so ; Use igbinary作爲會話串行器 session.serialize_handler = igbinary ;啓用或禁用壓縮重複字符串 ; #默認是開。 igbinary.compact_strings =在 ;使用igbinary作爲APC高速串行器(3.1.7或更高版本) apc.serializer = igbinary – Adam 2013-02-16 00:11:08

+0

是已經添加 - 延長= igbinary.so ... – Adam 2013-02-16 00:55:20