1. In PHP INI file: 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. 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
3. Restart PHP FPM.
Problems during installation:
The result is wrong:
This is the situation of Shenma again. I searched on the Internet. It turned out that when coding, zlib found that there was no such file. What should I do? Pretend
apt-get install zlib1g-dev
Then, after executing the following PECL install grpc, it is found that grpc is actually installed. According to the installation prompt, you need to install grpc Add so to PHP INI file for easy viewing;
echo "extension=grpc.so" >> /etc/php/7.2/cli/php.ini
Remember to restart:service php7.2-fpm restart
View module: pHp -m | grep “grpc”
At this point, the grpc installation is complete!
This is the end of this article on the specific steps of installing grpc extension for PHP. For more information on how to install grpc extension for PHP, please search the previous articles of developeppaer or continue to browse the relevant articles below. I hope you will support developeppaer in the future!