Merge pull request #231 from stanley-cheung/php_use_homebrew
Update PHP readme: use homebrew to compile grpc and protobuf
This commit is contained in:
commit
b3c74ba382
|
|
@ -8,6 +8,12 @@ This requires PHP 5.5 or greater.
|
||||||
|
|
||||||
INSTALL
|
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
|
- Clone this repository
|
||||||
|
|
||||||
|
|
@ -15,15 +21,6 @@ INSTALL
|
||||||
$ git clone https://github.com/grpc/grpc-common.git
|
$ git clone https://github.com/grpc/grpc-common.git
|
||||||
```
|
```
|
||||||
|
|
||||||
- Install Protobuf-PHP
|
|
||||||
|
|
||||||
```
|
|
||||||
$ git clone https://github.com/murgatroid99/Protobuf-PHP.git
|
|
||||||
$ cd Protobuf-PHP
|
|
||||||
$ rake pear:package version=1.0
|
|
||||||
$ pear install Protobuf-1.0.tgz
|
|
||||||
```
|
|
||||||
|
|
||||||
- Install composer
|
- Install composer
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
@ -40,16 +37,7 @@ INSTALL
|
||||||
- (Temporary workaround) Compile gRPC extension from source
|
- (Temporary workaround) Compile gRPC extension from source
|
||||||
|
|
||||||
```
|
```
|
||||||
$ git clone https://github.com/grpc/grpc.git
|
$ curl -fsSL https://goo.gl/getgrpc | bash -s php
|
||||||
$ cd grpc
|
|
||||||
$ git checkout --track origin/release-0_9
|
|
||||||
$ git pull --recurse-submodules && git submodule update --init --recursive
|
|
||||||
$ cd third_party/protobuf
|
|
||||||
$ ./autogen.sh && ./configure --prefix=/usr && make && make install
|
|
||||||
$ cd ../..
|
|
||||||
$ make && make install
|
|
||||||
$ cd src/php/ext/grpc
|
|
||||||
$ phpize && ./configure && make && make install
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -58,7 +46,7 @@ TRY IT!
|
||||||
|
|
||||||
- Run the server
|
- Run the server
|
||||||
|
|
||||||
Please follow the instruction in [Node](https://github.com/grpc/grpc-common/tree/master/node) to run the server
|
Please follow the instruction in [Node][] to run the server
|
||||||
```
|
```
|
||||||
$ cd grpc-common/node
|
$ cd grpc-common/node
|
||||||
$ nodejs greeter_server.js
|
$ nodejs greeter_server.js
|
||||||
|
|
@ -82,3 +70,8 @@ TUTORIAL
|
||||||
--------
|
--------
|
||||||
|
|
||||||
Coming soon
|
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
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,16 @@
|
||||||
{
|
{
|
||||||
|
"repositories": [
|
||||||
|
{
|
||||||
|
"type": "vcs",
|
||||||
|
"url": "https://github.com/stanley-cheung/Protobuf-PHP"
|
||||||
|
}
|
||||||
|
],
|
||||||
"name": "grpc/grpc-demo",
|
"name": "grpc/grpc-demo",
|
||||||
"description": "gRPC example for PHP",
|
"description": "gRPC example for PHP",
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5.0",
|
"php": ">=5.5.0",
|
||||||
|
"datto/protobuf-php": "dev-master",
|
||||||
"grpc/grpc": "dev-master"
|
"grpc/grpc": "dev-master"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require 'DrSlump/Protobuf.php';
|
|
||||||
\DrSlump\Protobuf::autoload();
|
|
||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
require 'helloworld.php';
|
require 'helloworld.php';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue