Home > Article > Backend Development > How to install grpc extension in php
How to install grpc extension in php: first add grpc extension configuration in php.ini file; then install protobuf and its php extension; finally restart php-fpm.
The operating environment of this article: CentOS Linux release 7.6.1810 system, PHP7.1 version, Dell G3 computer
How to install php grpc extension?
PHP71 Install Google gRPC extension
Steps to "open" gRPC
Install gRPC and its php extension
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
Add grpc extension configuration in the php.ini file: extension=grpc.so
Install protobuf and its php extension
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
Add protobuf extension configuration in the php.ini file: extension=protobuf .so
Restart php-fpm
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to install grpc extension in php. For more information, please follow other related articles on the PHP Chinese website!