php安装grpc扩展的具体步骤

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

git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpccd grpcgit submodule update --initmakemake installcd src/php/ext/grpcphpize./configure --with-php-config=/usr/local/php/bin/php-configmakemake installvi /usr/local/php/etc/php.ini

2、安装 protobuf及其php扩展
cd ../../../../third_party/protobuf./autogen.sh./configuremakemake installcd php/ext/google/protobufphpize./configure --with-php-config=/usr/local/php/bin/php-configmakemake installvi /usr/local/php/etc/php.ini

3、重启php-fpm。
安装中出现的问题:
结果报错了:
Error:src/core/lib/compression/message_compress.lo' failed
这个又是神马情况,在网上搜索了一通,原来是在编码的时候,虚招zlib发现没有这个文件,怎么办?装呗
apt-get install zlib1g-dev

【php安装grpc扩展的具体步骤】

然后在执行以下pecl install grpc发现居然安装上去了,根据安装提示需要将grpc.so添加到php.ini文件中方便查看;
echo "extension=grpc.so" >> /etc/php/7.2/cli/php.ini



记得重启下:service php7.2-fpm restart
查看模块: php -m | grep "grpc"
至此,这个grpc安装完成了!

到此这篇关于php安装grpc扩展的具体步骤的文章就介绍到这了,更多相关php安装grpc扩展的方法内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

    推荐阅读