Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
echo/ | 12-May-2024 | - | 469 | 301 | ||
route_guide/ | 12-May-2024 | - | 258 | 151 | ||
.gitignore | D | 12-May-2024 | 22 | 3 | 2 | |
README.md | D | 12-May-2024 | 1 KiB | 57 | 38 | |
composer.json | D | 12-May-2024 | 348 | 16 | 15 | |
greeter_client.php | D | 12-May-2024 | 1.5 KiB | 45 | 19 | |
greeter_proto_gen.sh | D | 12-May-2024 | 728 | 17 | 1 | |
run_greeter_client.sh | D | 12-May-2024 | 691 | 20 | 4 |
README.md
1# gRPC PHP Quick Start Example 2 3 4## Prerequisites 5 6This requires `php` >= 5.5, `pecl`, `composer` 7 8## Install 9 10 - Install the `grpc` extension 11 12 ```sh 13 $ [sudo] pecl install grpc 14 ``` 15 16 - Install the `protoc` compiler plugin `grpc_php_plugin` 17 18 ```sh 19 $ git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc 20 $ cd grpc 21 $ make grpc_php_plugin 22 ``` 23 24 - Install the `grpc/grpc` composer package 25 26 ``` 27 $ cd examples/php 28 $ composer install 29 ``` 30 31## Try it! 32 33 - Run the server 34 35 Please follow the instruction in [Node][] to run the server 36 ``` 37 $ cd examples/node 38 $ npm install 39 $ cd dynamic_codegen or cd static_codegen 40 $ node greeter_server.js 41 ``` 42 43 - Generate proto files and run the client 44 45 ``` 46 $ cd examples/php 47 $ ./greeter_proto_gen.sh 48 $ ./run_greeter_client.sh 49 ``` 50 51## In-depth Tutorial 52 53You can find a more detailed tutorial in [gRPC Basics: PHP][] 54 55[Node]:https://github.com/grpc/grpc/tree/master/examples/node 56[gRPC Basics: PHP]:https://grpc.io/docs/languages/php/basics 57