|
|
%!s(int64=5) %!d(string=hai) anos | |
|---|---|---|
| .. | ||
| echo | %!s(int64=6) %!d(string=hai) anos | |
| route_guide | %!s(int64=8) %!d(string=hai) anos | |
| .gitignore | %!s(int64=10) %!d(string=hai) anos | |
| README.md | %!s(int64=5) %!d(string=hai) anos | |
| composer.json | %!s(int64=5) %!d(string=hai) anos | |
| greeter_client.php | %!s(int64=5) %!d(string=hai) anos | |
| greeter_proto_gen.sh | %!s(int64=5) %!d(string=hai) anos | |
| run_greeter_client.sh | %!s(int64=8) %!d(string=hai) anos | |
This requires php >= 5.5, pecl, composer
Install the grpc extension
$ [sudo] pecl install grpc
Install the protoc compiler plugin grpc_php_plugin
$ git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc
$ cd grpc
$ make grpc_php_plugin
Install the grpc/grpc composer package
$ cd examples/php
$ composer install
Please follow the instruction in Node to run the server
$ cd examples/node
$ npm install
$ cd dynamic_codegen or cd static_codegen
$ node greeter_server.js
Generate proto files and run the client
$ cd examples/php
$ ./greeter_proto_gen.sh
$ ./run_greeter_client.sh
You can find a more detailed tutorial in gRPC Basics: PHP