Specific steps for installing grpc extension in PHP

Time:2022-5-5

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:

Error:src/core/lib/compression/message_compress.lo’ failed

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!

Recommended Today

JS generate guid method

JS generate guid method https://blog.csdn.net/Alive_tree/article/details/87942348 Globally unique identification(GUID) is an algorithm generatedBinaryCount Reg128 bitsNumber ofidentifier , GUID is mainly used in networks or systems with multiple nodes and computers. Ideally, any computational geometry computer cluster will not generate two identical guids, and the total number of guids is2^128In theory, it is difficult to make two […]