blob: f361fc4f009a0973b1b92cedb46985e05bb2bb77 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
gRPC in 3 minutes (PHP)
===========================
PREREQUISITES
-------------
This requires PHP 5.5 or greater.
INSTALL
-------
- On Mac OS X, install [homebrew][]. On Linux, install [linuxbrew][]. Run the following command to install gRPC.
```sh
$ curl -fsSL https://goo.gl/getgrpc | bash -
```
This will download and run the [gRPC install script][].
- Clone this repository
```sh
$ git clone https://github.com/grpc/grpc-common.git
```
- Install composer
```
$ cd grpc-common/php
$ curl -sS https://getcomposer.org/installer | php
```
- (Coming soon) Download the gRPC PECL extension
```
Coming soon
```
- (Temporary workaround) Compile gRPC extension from source
```
$ curl -fsSL https://goo.gl/getgrpc | bash -s php
```
TRY IT!
-------
- Run the server
Please follow the instruction in [Node][] to run the server
```
$ cd grpc-common/node
$ nodejs greeter_server.js
```
- Run the client
```
$ cd grpc-common/php
$ php composer.phar install
$ php -d extension=grpc.so greeter_client.php
```
NOTE
----
This directory has a copy of `helloworld.proto` because it currently depends on
some Protocol Buffer 2.0 syntax. There is no proto3 support for PHP yet.
TUTORIAL
--------
Coming soon
[homebrew]:http://brew.sh
[linuxbrew]:https://github.com/Homebrew/linuxbrew#installation
[gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
[Node]:https://github.com/grpc/grpc-common/tree/master/node
|