编译安装 IgBinary 扩展

2020-10-23 16:00:47 浏览数 (1)

# 简介

IgBinary ,第三方序列化扩展,替代默认的 serialize,具有高性能、节省空间等特点

# 下载

代码语言:javascript复制
$ git clone https://github.com/igbinary/igbinary.git

1

# 安装

代码语言:javascript复制
$ phpize
$ ./configure --with-php-config=/www/server/php/72/bin/php-config
$ sudo make
$ sudo make install

1 2 3 4

# 配置

代码语言:javascript复制
; Load igbinary extension
extension=igbinary.so

; Use igbinary as session serializer
session.serialize_handler=igbinary

; Enable or disable compacting of duplicate strings
; The default is On.
igbinary.compact_strings=On

; If uncommented, use igbinary as the serializer of APCu
; (APCu 5.1.10 or newer is strongly recommended)
apc.serializer=igbinary

1 2 3 4 5 6 7 8 9 10 11 12 13

# 验证

代码语言:javascript复制
$ php -m | grep igbinary

1

输出 igbinary 说明成功

# 用法

  • igbinary_serialize
  • igbinary_unserialize

0 人点赞