Skip to content

Instantly share code, notes, and snippets.

@sagikazarmark
Last active February 11, 2024 19:29
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save sagikazarmark/ab5ceb2338c043f6e000d801abca2b25 to your computer and use it in GitHub Desktop.
Save sagikazarmark/ab5ceb2338c043f6e000d801abca2b25 to your computer and use it in GitHub Desktop.
Install the gRPC PHP plugin
# Install the gRPC PHP plugin on Mac
#
# See: http://www.grpc.io/docs/quickstart/php.html#install-protobuf-plugin
# Source: https://gist.github.com/johndpope/503029706ed56d5375d1e9469f0135d4
# Install build dependencies
brew install automake libtool
## Clone gRPC repo
git clone --recursive -b v1.4.x https://github.com/grpc/grpc
cd grpc
cd third_party/protobuf
./autogen.sh
./configure CC=clang CXX=clang++
make
make install
cd ../..
make
make grpc_php_plugin
@betapcode
Copy link

Mac OS 10.15, Not working with me, have error
./configure CC=clang CXX=clang++
Change:
./configure AR=/usr/bin/ar RANLIB=/usr/bin/ranlib

@oleg-brizy
Copy link

This should be faster

git clone --recursive --depth 1 --shallow-submodules -b ...

@peterfox
Copy link

A note for people who just use brew... do:

brew install grpc

As of 13th Oct 2021 you only get version 1.39.1 but will still provide grpc_php_plugin in /usr/local/bin/grpc_php_plugin

@Nek-
Copy link

Nek- commented Feb 11, 2024

Thank you very much @peterfox this is definitely the best option. It was installed in the folder /opt/homebrew/Cellar/grpc/1.60.0_1/bin/grpc_php_plugin for me (which is the new folder homebrew install stuff iirc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment