You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will compile and install the gRPC PHP extension into the standard PHP extension directory. You should be able to run the [unit tests](#unit-tests), with the PHP extension installed.
51
+
This will compile and install the gRPC PHP extension into the standard PHP
52
+
extension directory. You should be able to run the [unit tests](#unit-tests),
53
+
with the PHP extension installed.
54
+
55
+
56
+
**Add the gRPC PHP library as a Composer dependency**
57
+
58
+
You need to add this to your project's `composer.json` file.
59
+
60
+
```
61
+
"require": {
62
+
"grpc/grpc": "v1.0.0"
63
+
}
64
+
```
65
+
66
+
To run tests with generated stub code from `.proto` files, you will also need
67
+
the `composer` and `protoc` binaries. You can find out how to get these
68
+
[below](#generated-code-tests).
69
+
39
70
40
-
To run tests with generated stub code from `.proto` files, you will also need the `composer`, `protoc` and `protoc-gen-php` binaries. You can find out how to get these [below](#generated-code-tests).
41
71
42
72
## Build from Source
43
73
@@ -98,45 +128,46 @@ $ ./bin/run_tests.sh
98
128
99
129
## Generated Code Tests
100
130
101
-
This section specifies the prerequisites for running the generated code tests, as well as how to run the tests themselves.
131
+
This section specifies the prerequisites for running the generated code tests,
132
+
as well as how to run the tests themselves.
102
133
103
134
### Composer
104
135
105
-
If you don't have it already, install `composer` to pull in some runtime dependencies based on the `composer.json` file.
136
+
Install the runtime dependencies via `composer install`.
If you compiled the gRPC C core library from source above, the `protoc` binary should have been installed as well. If it hasn't been installed, you can run the following commands to install it.
151
+
If you really must compile `protoc` from source, you can run the following
152
+
commands, but this is risky because there is no easy way to uninstall /
153
+
upgrade to a newer release.
120
154
121
155
```sh
122
156
$ cd grpc/third_party/protobuf
123
-
$ sudo make install # 'make' should have been run by core grpc
157
+
$ ./autogen.sh && ./configure && make
158
+
$ sudo make install
124
159
```
125
160
126
-
Alternatively, you can download `protoc` binaries from [the protocol buffers Github repository](https://github.com/google/protobuf/releases).
127
161
162
+
### PHP Protoc Plugin
128
163
129
-
### PHP protobuf compiler
164
+
You need the gRPC PHP protoc plugin to generate the client stub classes.
130
165
131
-
You need to install `protoc-gen-php` to generate stub class `.php` files from service definition `.proto` files.
166
+
It should already been compiled when you run `make` from the root directory
167
+
of this repo. The plugin can be found in the `bins/opt` directory. We are
168
+
planning to provide a better way to download and install the plugin
0 commit comments