PHP71 安装Google gRPC扩展

一、软件环境
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扩展)