美文网首页
PHP71 安装Google gRPC扩展

PHP71 安装Google gRPC扩展

作者: GeorgePeng | 来源:发表于2019-08-19 19:31 被阅读0次

一、软件环境
CentOS Linux release 7.6.1810
PHP版本7.1

二、“打开” gRPC 的步骤

  1. 安装 gRPC 及其 php 扩展
    git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc
    cd grpc
    git submodule update --init
    make
    make install

cd src/php/ext/grpc
phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
vi /usr/local/php/etc/php.ini

在 php.ini 文件中添加 grpc 扩展配置:extension=grpc.so

  1. 安装 protobuf 及其 php 扩展
    cd ../../../../third_party/protobuf
    ./autogen.sh
    ./configure
    make
    make install

cd php/ext/google/protobuf
phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
vi /usr/local/php/etc/php.ini

在 php.ini 文件中添加 protobuf 扩展配置:extension=protobuf.so

  1. 重启 php-fpm

参考文档
https://grpc.io/docs/quickstart/php.html
https://blog.csdn.net/bbwangj/article/details/82253785

相关文章

网友评论

      本文标题:PHP71 安装Google gRPC扩展

      本文链接:https://www.haomeiwen.com/subject/qxuesctx.html