1. Add grpc extension configuration in the php.ini file: extension=grpc.so
git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc cdgrpc 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.
The above is how to install the grpc extension in php. I hope it will be helpful to everyone.