Download the PHP package bsn4/grpc without Composer
On this page you can find all versions of the php package bsn4/grpc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package grpc
Short Description Rust-based gRPC extension for PHP — drop-in replacement for ext-grpc
License MIT
Homepage https://github.com/BSN4/grpc-php-rs
Informations about the package grpc
grpc-php-rs
A Rust-based gRPC extension for PHP — drop-in replacement for the official ext-grpc.
Why?
The official C-based grpc extension has long-standing issues:
- ZTS/TSRM crashes — segfaults under FrankenPHP, Swoole, and other threaded SAPIs
- OpenSSL/BoringSSL conflicts — the bundled BoringSSL collides with PHP's OpenSSL, breaking
ext-curland other extensions
grpc-php-rs solves both by using a pure Rust stack: tonic for gRPC, rustls for TLS (no OpenSSL), and ext-php-rs for PHP bindings.
Install
Docker (recommended)
One line in your Dockerfile — no build tools needed:
For ZTS (FrankenPHP, Swoole, etc.):
For Alpine:
Available tags: latest-php{8.2,8.3,8.4,8.5} for Debian, append -alpine for Alpine, append -zts for thread-safe (e.g. latest-php8.5-alpine-zts). Version-pinned tags like v0.2.1-php8.5-alpine are also available.
Via PIE
Requires PIE 1.4.0+ for pre-packaged binary support.
Manual download
Download the appropriate .so from the latest release, then:
Alpine note: When using the
linux-muslbinary outside of the Docker install image, you also needapk add --no-cache libgcc. The Docker install image bundles this for you.
Supported Platforms
| PHP | OS | Arch | Thread Safety |
|---|---|---|---|
| 8.2, 8.3, 8.4, 8.5 | Linux (glibc) | x86_64 | NTS, ZTS |
| 8.2, 8.3, 8.4, 8.5 | Linux (glibc) | ARM64 | NTS, ZTS |
| 8.2, 8.3, 8.4, 8.5 | Linux (musl/Alpine) | x86_64 | NTS, ZTS |
| 8.2, 8.3, 8.4, 8.5 | Linux (musl/Alpine) | ARM64 | NTS, ZTS |
| 8.2, 8.3, 8.4, 8.5 | macOS | ARM64 | NTS |
| 8.2, 8.3, 8.4, 8.5 | Windows | x86_64 | NTS |
Usage
grpc-php-rs is a drop-in replacement. Add to your php.ini:
Then use the Grpc\ namespace as normal:
All existing gRPC PHP code works unchanged — Grpc\Channel, Grpc\ChannelCredentials, Grpc\CallCredentials, Grpc\Timeval, and all call types (UnaryCall, ServerStreamingCall, ClientStreamingCall, BidiStreamingCall).
Building from Source
Requirements:
- Rust toolchain (stable; nightly required on Windows)
- PHP 8.2+ development headers (
php-dev/php-devel)
Running Tests
See ./test.sh --help for all options.
License
MIT