您的位置 首页 php

关于编译安装msgpack-php的方法

Msgpack 是一个 PECL 扩展,此扩展提供用于与 MessagePack 序列化通信的 API。

MessagePack 是一个基于二进制高效的对象序列化类库,可用于跨语言通信。它可以像JSON那样,在许多种语言之间交换结构对象;但是它比JSON更快速也更轻巧。

下载

wget https://github.com/msgpack/msgpack-php/archive/msgpack-2.0.3.tar.gz

解压

tar -zxvf msgpack-2.0.3.tar.gz cd msgpack-php-msgpack-2.0.3/

查看phpize文件路径

$ whereis phpizephpize: /usr/local/php-7.2.9/bin/phpize

从源代码编译 

$./configure$make && make install

修改配置文件

sudo vim /usr/local/php-7.2.9/etc/php.ini // 增加以下扩展extension=msgpack.so

重启php-fpm 检查是否安装成功

sudo systemctl restart php-fpm.service

b7c6d75701fdeb78db8db5cceb7c205.png

官方简单案例 msgpack-test.php

<?php$data = array(0=>1,1=>2,2=>3);$msg = msgpack_pack($data);var_dump($data);echo '----------------';var_dump($msg); $data = msgpack_unpack($msg);var_dump($data);

运行结果

array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}----------------string(4) ""array(3) {  [0]=>  int(1)  [1]=>  int(2)  [2]=>  int(3)}

更多php相关知识,请访问php教程!

以上就是关于编译安装msgpack-php的方法的详细内容,更多请关注求知技术网其它相关文章!

文章来源:智云一二三科技

文章标题:关于编译安装msgpack-php的方法

文章地址:https://www.zhihuclub.com/2096.shtml

关于作者: 智云科技

热门文章

发表回复

您的电子邮箱地址不会被公开。

7条评论

  1. Also, ANOVA of the data showed that there are significant differences p max and AUC 0-t of both groups with p-values of 0

  2. A1C Blood Sugar Test You have options and we are here to help you find the best solution

  3. Unfortunately, many women are diagnosed with low progesterone because they are advised to check the level on day 21 of the cycle. This can also improve other PCOS symptoms like unwanted hair, acne, anxiety, and depression.

网站地图