brew install protobuf
brew install grpc
pecl install grpc
Notice: you can also compile everything by yourself and it's documented here.
Example of usage:
protoc --proto_path=src/protos \
--php_out=generated/php \
--grpc_out=generate_server:generated/php \
--plugin=protoc-gen-grpc=/opt/homebrew/Cellar/grpc/1.60.0_1/bin/grpc_php_plugin protos/helloworld.proto