星期二, 12月 20, 2016

Install igbinary



  1. 安裝
    • 透過PECL
      pecl install igbinary
    • 透過Source Code
      1. 下載igbinary.tgz
        wget https://pecl.php.net/get/igbinary-2.0.0.tgz
        
      2. Install
        #1 以igbinary-2.0.0.tgz為例
        cd {install}/ 
        #安裝igbinary-2.0.0.tgz
        $ tar zxvf igbinary-2.0.0.tgz
        $ cd igbinary-2.0.0..tgz/
        $ phpize
        $ ./configure
        $ make && make install
        如果./configure出現 no acceptable C compiler found in $PATH 需安裝gcc
  2. 檢查是否有igbinary.so
    $ ll /usr/lib64/php/modules/ | grep igbinary.so  
    -rwxr-xr-x 1 root root 312644 Dec 20 07:40 igbinary.so
  3. 編輯將igbinary.ini
     $ vi /etc/php.d/igbinary.ini 
     ============= 我是分隔線 =================  
    ; Enable igbinary extension module 
     extension=igbinary.so 
     ; Enable or disable compacting of duplicate strings  
    ; The default is On.  igbinary.compact_strings=On 
     ; Use igbinary as session serializer 
     session.serialize_handler=igbinary 
     ; Use igbinary as APC serializer 
     apc.serializer=igbinary    # php7後,還沒試過
  4.  重新啟動apache
     $ service httpd restart 
     $ php -m | grep igbinary #檢查是否安裝成功 
     igbinary 
 Reference
  1. http://www.metod.si/how-to-install-igbinary-serializer-for-php/ 
  2. http://blog.csdn.net/zhangxinrun/article/details/16964819 
  3. http://www.cnblogs.com/cndavidwang/p/3335846.html 
  4. http://bensnotepad.com/install-igbinary-for-php5-on-ubuntu/

沒有留言: