{"id":37879626,"url":"https://github.com/cjyzwg/grpc-php","last_synced_at":"2026-01-16T16:47:35.483Z","repository":{"id":44205956,"uuid":"208471726","full_name":"cjyzwg/grpc-php","owner":"cjyzwg","description":"grpc server:go,client:php/go","archived":false,"fork":false,"pushed_at":"2023-02-24T23:02:44.000Z","size":19,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T07:55:31.963Z","etag":null,"topics":["grpc","grpc-client","grpc-php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cjyzwg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-14T16:48:15.000Z","updated_at":"2019-09-14T18:50:26.000Z","dependencies_parsed_at":"2024-06-20T07:17:48.421Z","dependency_job_id":null,"html_url":"https://github.com/cjyzwg/grpc-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cjyzwg/grpc-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjyzwg%2Fgrpc-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjyzwg%2Fgrpc-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjyzwg%2Fgrpc-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjyzwg%2Fgrpc-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cjyzwg","download_url":"https://codeload.github.com/cjyzwg/grpc-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjyzwg%2Fgrpc-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc","grpc-client","grpc-php"],"created_at":"2026-01-16T16:47:34.842Z","updated_at":"2026-01-16T16:47:35.470Z","avatar_url":"https://github.com/cjyzwg.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grpc php client \n**服务端取的是https://www.jianshu.com/p/7fe7a8507745 案例**  \n\n\n#### 需要执行\n\u003e export GO111MODULE=on  \ngo mod tidy\n#### 安装依赖\n\u003epecl install grpc  \npecl install protobuf  \n同时并.so 文件放进ini中，如果是在docker中使用docker-php-ext-enable grpc,docker-php-ext-enable protobuf  \nwget https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-all-3.5.1.zip  \nunzip protobuf-all-3.5.1.zip  \ncd protobuf-3.5.1/  \n./configure  \nmake  \nmake install  \nprotoc --version  \n出现make 错误，安装apt-get install automake  \nldconfig  \n\n1、protoc --proto_path=../../ --php_out=. helloServer.proto  \n2、在client/phpclient/Rpc_proto 文件夹新建HelloClient.php  \n\n    \u003c?php\n\t\tnamespace Rpc_proto;\n\t\tclass HelloClient extends \\Grpc\\BaseStub{\n\t\t\tpublic function __construct($hostname, $opts, $channel = null) {\n\t\t\t\tparent::__construct($hostname, $opts, $channel);\n\t\t\t}\n\t\t\tpublic function SayHello(\\Rpc_proto\\HelloRequest $argument,$metadata=[],$options=[]){\n\t\t\t\treturn $this-\u003e_simpleRequest('/rpc_proto.HelloServer/SayHello',\n\t\t\t\t\t$argument,\n\t\t\t\t\t['\\Rpc_proto\\HelloReply', 'decode'],\n\t\t\t\t\t$metadata, $options);\n\t\t\t}\n\t\t\tpublic function GetHelloMsg(\\Rpc_proto\\HelloRequest $argument,$metadata=[],$options=[]){\n\t\t\t\treturn $this-\u003e_simpleRequest('/rpc_proto.HelloServer/GetHelloMsg',\n\t\t\t\t\t$argument,\n\t\t\t\t\t['\\Rpc_proto\\HelloMessage', 'decode'],\n\t\t\t\t\t$metadata, $options);\n\t\t\t}\n\t\t}\n\t?\u003e\n3、cd client/phpclient \u0026\u0026 composer install  \n4、cd server \u0026\u0026 go run server.go  \n5、新建hello.php,并执行php hello.php\n结果：\n\u003e helloGreenHat  \nthis is from server HAHA!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjyzwg%2Fgrpc-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcjyzwg%2Fgrpc-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjyzwg%2Fgrpc-php/lists"}