How to install gRPC extension on RunCloud | Nginx

 

How to install gRPC extension on RunCloud | Nginx

Installing gRPC Module on RunCloud

If you're using RunCloud for PHP 8.1(you can just change the version for other versions) and need to install the gRPC module, follow the steps outlined below. Adjust the steps accordingly if you're using a different PHP version, and ensure you select the appropriate gRPC version for your requirements.

Step 1: Install Dependencies

Start by installing the required dependencies using the following command:

apt-get install autoconf libpcre3-dev

Step 2: Download the gRPC Module

Download the gRPC module by executing the following commands:

MODULE_NAME="grpc" 
MODULE_VERSION="1.55.0" 
cd ~ 
wget https://pecl.php.net/get/$MODULE_NAME-$MODULE_VERSION.tgz 
tar -zxvf $MODULE_NAME-$MODULE_VERSION.tgz 
cd $MODULE_NAME-$MODULE_VERSION

Step 3: Clean and Prepare PHPize

Clean the PHPize environment using the following command:

/RunCloud/Packages/php81rc/bin/phpize --clean

Then, prepare PHPize with the following command:

/RunCloud/Packages/php81rc/bin/phpize

Step 4: Configure and Install the Module

Configure and install the gRPC module by running the following commands:

./configure --with-libdir=lib64 CFLAGS='-O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fsigned-char -fno-strict-aliasing' --with-php-config=/RunCloud/Packages/php81rc/bin/php-config 

make install

Step 5: Enable the Module

To enable the gRPC module, create a configuration file with the following command:

echo "extension=$MODULE_NAME.so" > /etc/php81rc/conf.d/$MODULE_NAME.ini

Step 6: Restart PHP-FPM

Finally, restart the PHP-FPM service to apply the changes:

systemctl restart php81rc-fpm.service

Verification

To verify the successful installation of the gRPC module, run the following command:

/RunCloud/Packages/php81rc/bin/php -m | grep grpc

If the installation was successful, you should see the "grpc" module listed in the output.

Conclusion

By following these steps, you can easily install the gRPC module (version 1.55.0) on RunCloud for PHP 8.1. If you encounter any issues or need further assistance, please don't hesitate to reach out to us.


Comments

Post a Comment