OLD | NEW |
(Empty) | |
| 1 gRPC in 3 minutes (PHP) |
| 2 =========================== |
| 3 |
| 4 PREREQUISITES |
| 5 ------------- |
| 6 |
| 7 This requires `php` >=5.5, `phpize`, `pecl`, `phpunit` |
| 8 |
| 9 INSTALL |
| 10 ------- |
| 11 - Install the gRPC PHP extension |
| 12 |
| 13 ```sh |
| 14 $ [sudo] pecl install grpc-beta |
| 15 ``` |
| 16 |
| 17 - Clone this repository |
| 18 |
| 19 ```sh |
| 20 $ git clone https://github.com/grpc/grpc.git |
| 21 ``` |
| 22 |
| 23 - Install composer |
| 24 |
| 25 ``` |
| 26 $ cd examples/php |
| 27 $ curl -sS https://getcomposer.org/installer | php |
| 28 $ php composer.phar install |
| 29 ``` |
| 30 |
| 31 TRY IT! |
| 32 ------- |
| 33 |
| 34 - Run the server |
| 35 |
| 36 Please follow the instruction in [Node][] to run the server |
| 37 ``` |
| 38 $ cd examples/node |
| 39 $ npm install |
| 40 $ nodejs greeter_server.js |
| 41 ``` |
| 42 |
| 43 - Run the client |
| 44 |
| 45 ``` |
| 46 $ cd examples/php |
| 47 $ ./run_greeter_client.sh |
| 48 ``` |
| 49 |
| 50 NOTE |
| 51 ---- |
| 52 |
| 53 This directory has a copy of `helloworld.proto` because it currently depends on |
| 54 some Protocol Buffer 2.0 syntax. There is no proto3 support for PHP yet. |
| 55 |
| 56 TUTORIAL |
| 57 -------- |
| 58 |
| 59 You can find a more detailed tutorial in [gRPC Basics: PHP][] |
| 60 |
| 61 [Node]:https://github.com/grpc/grpc/tree/master/examples/node |
| 62 [gRPC Basics: PHP]:http://www.grpc.io/docs/tutorials/basic/php.html |
OLD | NEW |