Quick start
This guide gets you started with gRPC in Go with a simple working example.
Prerequisites
-
Go, any one of the three latest major releases of Go.
For installation instructions, see Go’s Getting Started guide.
-
Protocol buffer compiler,
protoc
, version 3.For installation instructions, see Protocol Buffer Compiler Installation.
-
Go plugins for the protocol compiler:
-
Install the protocol compiler plugins for Go using the following commands:
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
-
Update your PATH
so that the protoc
compiler can find the plugins:
$ export PATH="$PATH:$(go env GOPATH)/bin"
To install missing grpc_php_plugin, just copy below command and run as root user.
cd /tmp && git clone -b v1.34.1 --depth 1 https://github.com/grpc/grpc && cd grpc && git submodule update --init && make grpc_php_plugin
Or try build as bazel.
./tools/bazel build @com_google_protobuf//:protoc
./tools/bazel build src/compiler:grpc_php_plugin