How to use gRPC from PHP and Windows 10 with the "grpc_php_plugin"?

Viewed 1228

When trying to use gRPC from Windows with PHP, I could find Windows binaries for "protoc.exe" and "php_grpc.dll" but I have not been able to find any "grpc_php_plugin" (exe or dll?) and thus have not succeeded to use gRPC from Windows/PHP.

Documentation page:

https://grpc.io/docs/quickstart/php/

The current documentation at the above paqe is unix-oriented (with "make grpc_php_plugin" and "bins/opt" paths in flags such as --plugin=protoc-gen-grpc=bins/opt/grpc_php_plugin).

However, it kind of seems as Windows should be supported since the page does mention "Install on Windows You can download the pre-compiled grpc.dll extension from the PECL website."

On the other hand, if only two of the three needed binaries are available, then it is not enough, since as far as I understand, the following three binaries are needed:

When trying to use the example at the quickstart page, you find this example command:

protoc --proto_path=examples/protos --php_out=examples/php --grpc_out=examples/php --plugin=protoc-gen-grpc=bins/opt/grpc_php_plugin ./examples/protos/helloworld.proto

The problem is the plugin flag "--plugin=protoc-gen-grpc=bins/opt/grpc_php_plugin".

When using Windows, you have not compiled with "make grpc_php_plugin" but need to download a binary for Windows and put it in a Windows path instead of the "bins/opt/grpc_php_plugin".

So, if anyone has actually been able to use gRPC for PHP with Windows 10, then please explain to make it work regarding the "grpc_php_plugin" which seems to be needed but not available.

2 Answers
Related