How to install grpc for PHP in

Hello community and thank you for this forum.

I’m new to and using grpc to communicate with CloudFirestore on my Symfony app.

I’m not sure I fully understand how I should install grpc extension php on the environment.

I need to follow this :
I need to install PECL with this command
sudo apt-get install autoconf zlib1g-dev php-dev php-pear
then install grpc through that.
I also need to enable
Should I modify the file like this?

     grpc/grpc: "1.48.0"
     compose/compose: "^2"

Load a bash .sh script for the install command ?

I saw in the documentation that I could load a new php.ini file or maybe use ‘variable’ in instead, but I’m not sure how to do it right…

Thank you very much for your help and your time

Hi there!

We have a section in our documentation covering Installing Custom PHP extensions. You won’t have access to apt-get on our containers.

Our team also maintains a few example snippets for installing specific extensions that you can take a look at (swoole, relay, and phpredis).

For future people getting to this article, I wrote a pecl tool that simplifies the building of custom extensions through pecl and also uses the PLATFORM_CACHE to speed up subsequent builds.

Usage is as simple as

    build: |
        set -e  
        chmod +x pecl  
        ./pecl install grpc

The pecl source code can be found on github and can be placed inside your project folder. Feel free to change it as you see fit.