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擴充的方法,希望對大家有幫助。