• Home
Name Date Size #Lines LOC

..--

echo/12-May-2024-469301

route_guide/12-May-2024-258151

.gitignoreD12-May-202422 32

README.mdD12-May-20241 KiB5738

composer.jsonD12-May-2024348 1615

greeter_client.phpD12-May-20241.5 KiB4519

greeter_proto_gen.shD12-May-2024728 171

run_greeter_client.shD12-May-2024691 204

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