Imported Upstream version 1.27.0
[platform/upstream/grpc.git] / examples / php / README.md
1 # gRPC PHP Quick Start Example
2
3
4 ## Prerequisites
5
6 This 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 $(curl -L https://grpc.io/release) 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
53 You 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/tutorials/basic/php.html