php中如何安装grpc扩展

小编给大家分享一下php中如何安装grpc扩展,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

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

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

2、安装 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

3、重启php-fpm。

以上是“php中如何安装grpc扩展”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!