{"id":20671445,"url":"https://github.com/fajarbc/grpc-client-php-example","last_synced_at":"2026-04-17T23:36:16.433Z","repository":{"id":115653198,"uuid":"484889046","full_name":"fajarbc/grpc-client-php-example","owner":"fajarbc","description":"Example project of using gRPC client in PHP","archived":false,"fork":false,"pushed_at":"2022-04-24T00:45:20.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T17:29:50.115Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/fajarbc.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":"2022-04-24T00:44:40.000Z","updated_at":"2022-04-24T00:45:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"5dbaa36a-3915-409b-acc0-2c89ab04e4d0","html_url":"https://github.com/fajarbc/grpc-client-php-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fajarbc/grpc-client-php-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarbc%2Fgrpc-client-php-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarbc%2Fgrpc-client-php-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarbc%2Fgrpc-client-php-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarbc%2Fgrpc-client-php-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fajarbc","download_url":"https://codeload.github.com/fajarbc/grpc-client-php-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarbc%2Fgrpc-client-php-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-11-16T20:27:19.269Z","updated_at":"2026-04-17T23:36:16.418Z","avatar_url":"https://github.com/fajarbc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gRPC client with PHP : Todo App\nExample project of using gRPC client in PHP.\nBecause this is client only, to follow the example we must have gRPC server. For that, we'll use [gRPC with Nodejs : Todo App](https://github.com/fajarbc/grpc-nodejs-example)\n\n## Install\n1. Copy `env` to `.env`\n2. Be sure you have the PHP Extention.\n   1. Because i use Windows, i download `php_grpc.dll` file at [gRPC 1.43.0 for Windows](https://pecl.php.net/package/gRPC/1.43.0/windows).\n   2. Copy `php_grpc.dll` file to `php/ext` directory. In Xampp is located at `C:/xampp/php/ext`\n   3. Enable the extention.\n        - Open `php.ini` file. In Xampp is located at `C:/xampp/php`\n        - In the bottom of the file add this line to your `php.ini` file, save it and run the Xampp.\n            ```\n            extension=php_grpc.dll\n            ```\n\n   For more details, read at [gRPC Github](https://github.com/grpc/grpc/blob/v1.45.0/src/php/README.md#install-on-windows) or [gRPC GCP](https://cloud.google.com/php/grpc#windows).\n3. Install composer dependecies\n    ```bash\n    composer update\n    ```\n\n## Server\n### Install\n1. Clone [gRPC with Nodejs : Todo App](https://github.com/fajarbc/grpc-nodejs-example)\n    ```bash\n    git clone https://github.com/fajarbc/grpc-nodejs-example\n    cd grpc-nodejs-example\n    ```\n2. Follow the install instruction there\n### Run\n1. In [gRPC with Nodejs : Todo App](https://github.com/fajarbc/grpc-nodejs-example) root project, run\n    ```bash\n    npm run server\n    ```\n\n## Client\n### Make generated php files\n1. Install `protoc`\n   - [Download here](https://github.com/protocolbuffers/protobuf/releases) and add it to your path.\n   - Make sure `protoc` is installed. Run in your terminal `protoc --version`\n    - If it is installed, should output something like `libprotoc 3.20.1`\n2. Install `grpc_php_plugin`\n   1. Using cmake\n   2. Using bazel\n   3. I personally just download `.exe` file from [this repo](https://github.com/lifenglsf/grpc_for_windows)\n\n   For more, follow [this step](https://github.com/grpc/grpc/blob/v1.45.0/src/php/README.md#grpc_php_plugin-protoc-plugin). In windows, make sure you have `Visual Studio Build Tools` \n3. Install `protobuf`. Already using PHP Implementation with composer dependecy (no action needed)\n4. Build `php client`\n   ```bash\n    protoc -I=. todo.proto --php_out=php --plugin=protoc-gen-grpc=./grpc_php_plugin.exe\n    ```\n\n### Run the gRPC request\n1. Make sure you're in `client/` dir.\n    ```bash\n    cd client/\n    ```\n2. Sent data. Change `\"your text is here\"` to whatever text data you want to send\n    ```bash\n    php request.php \"your text is here\"\n    ```\n3. Read data todos\n    ```bash\n    php read.php\n    ```\n\n\n## TODO\n- `grpc_php_plugin.php` is not build by `cmake` or `bazel`. It version might not compatible or outdated.\n- `TodoClient.php` is not generated. So if todo.proto has more method in its service, we should create it manually.\n- Method `streamTodos` is not implemented yet in `TodoClient.php`. I tried but has no output when it run.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffajarbc%2Fgrpc-client-php-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffajarbc%2Fgrpc-client-php-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffajarbc%2Fgrpc-client-php-example/lists"}