#Overview
This directory contains source code for PHP implementation of gRPC layered on shared C library.
#Status
Pre-Alpha : This gRPC PHP implementation is work-in-progress and is not expected to work yet.
Install php5
and php5-dev
.
To run the tests, additionally install phpunit
.
Alternatively, build and install PHP 5.5 or later from source with standard configuration options.
On Mac OS X, install homebrew. On Linux, install linuxbrew. Run the following command to install gRPC.
$ curl -fsSL https://goo.gl/getgrpc | bash -s php
This will download and run the gRPC install script and compile the gRPC PHP extension.
Clone this repository
$ git clone https://github.com/grpc/grpc.git
Build and install the Protocol Buffers compiler (protoc)
$ cd grpc $ git pull --recurse-submodules && git submodule update --init --recursive $ cd third_party/protobuf $ ./autogen.sh $ ./configure $ make $ make check $ sudo make install
Build and install the gRPC C core
$ cd grpc
$ make
$ sudo make install
Build the gRPC PHP extension
$ cd grpc/src/php/ext/grpc $ phpize $ ./configure $ make $ sudo make install
In your php.ini file, add the line extension=grpc.so
to load the extension at PHP startup.
Install Composer
$ cd grpc/src/php $ curl -sS https://getcomposer.org/installer | php $ php composer.phar install
Run unit tests
$ cd grpc/src/php $ ./bin/run_tests.sh
Install protoc-gen-php
$ cd grpc/src/php/vendor/datto/protobuf-php $ gem install rake ronn $ rake pear:package version=1.0 $ sudo pear install Protobuf-1.0.tgz
Generate client stub code
$ cd grpc/src/php $ ./bin/generate_proto_php.sh
Run a local server serving the math services
$ cd grpc/src/node $ npm install $ nodejs examples/math_server.js
Run the generated code tests
$ cd grpc/src/php $ ./bin/run_gen_code_test.sh