Releases
Open the Download page for Linux, macOS, and Windows binaries, packages, and SHA-256 checksums.
v0.10.0 #
Rapira v0.10.0 moves to a single-process ZTS worker thread runtime and adds gRPC server streaming and remote descriptor URLs. It also adds rapira pack with an in-memory /app VFS, built-in HTTP compression middleware, PHP 8.6, static Linux binaries, and Distroless container images.
Breaking changes and how to upgrade # Breaking
1. Update rapira.toml server and pool keys
#
Rapira rejects unknown keys at startup. Apply these renames and removals to rapira.toml:
- Rename
[supervisor]to[server]. - Rename
process_control_timeout_secstostop_timeout_secs. - Rename
[http.pool].processesand[grpc.pool].processestoworkers. - Remove
[http.pool].max_memory_mb,[grpc.pool].max_memory_mb, and[http].io_threads. - Check relative
unix:listen paths in[http],[grpc], and[observability]. They now resolve against the directory ofrapira.tomlinstead of the current working directory.
Before (v0.9):
[supervisor]
pidfile = "/run/rapira.pid"
process_control_timeout_secs = 30
[http]
listen = "127.0.0.1:8000"
io_threads = 2
[http.pool]
entrypoint = "public/index.php"
mode = "worker"
processes = 4
max_memory_mb = 256After (v0.10):
[server]
pidfile = "/run/rapira.pid"
stop_timeout_secs = 30
[http]
listen = "127.0.0.1:8000"
[http.pool]
entrypoint = "public/index.php"
mode = "worker"
workers = 4See Configuration for every supported key.
2. Switch self-hosted PHP embeds to ZTS and check OPcache versions #
One server process now runs PHP workers as threads. Release binaries, packages, and container images ship thread-safe (ZTS) PHP.
- On Linux and macOS source builds, configure PHP with
--enable-zts --disable-zend-signals --enable-embed=shared. See Build from source. - A custom NTS
libphpbuild on Linux or macOS still runs, but allows only one pool and clampsworkersto1.
OPcache multi-worker requirement
Running more than one worker across all pools with OPcache enabled requires PHP 8.4.29, 8.5.14, 8.6.1, or newer. On older patch releases, set total workers to 1 or set opcache.enable = 0.
3. Update Dockerfiles for complete ZTS images and redis removal
#
ghcr.io/rapira-rs/rapira tags (php8.4, php8.5, php8.6) are now complete Debian Trixie ZTS images instead of a scratch payload for COPY --from. They build on the official PHP images (php:8.4-zts-trixie, php:8.5-zts-trixie, and php:8.6-cli-trixie). Rapira also removed the redis PHP extension because redis is unsafe under ZTS PHP.
Replace COPY --from layers with FROM ghcr.io/rapira-rs/rapira:php8.6 or FROM ghcr.io/rapira-rs/rapira:php8.6-distroless:
FROM ghcr.io/rapira-rs/rapira:php8.6
WORKDIR /app
COPY . /app
CMD ["rapira", "serve", "/app/rapira.toml"]Replace the redis extension with a pure-PHP client such as Predis, or build a ZTS-safe extension. See Docker and Distroless.
4. Remove deleted Prometheus metrics #
Because workers run as threads in one process, Rapira removed these per-process metric families from /metrics:
rapira_worker_exits_totalrapira_worker_rss_bytesrapira_worker_pss_bytes
Remove these series from Prometheus dashboards and alert rules. Monitor process memory through container or host metrics instead. See Metrics and health checks.
5. Do not retain $call->getResponseMetadata() past call finalization
#
In the gRPC plugin, $call->getResponseMetadata() returns the call object itself (UnaryCall or ServerStreamingCall). Do not store that return value in a property or static variable across iterations.
$call->getResponseMetadata()->addHeader('x-server', 'rapira');
$call->respond($payload);See Metadata.
6. Validate Content-Length headers in HTTP Dispatcher mode
#
Exchange::writeHead() throws \ValueError if content-length repeats or is not a non-negative integer. Remove duplicate Content-Length entries before calling writeHead(). See Dispatcher mode.
gRPC server streaming and remote descriptor sets # Major feature
Rapira serves server-streaming RPCs over gRPC, binary gRPC-Web, and Connect streaming. GrpcDispatcher::receive() returns either a UnaryCall or a ServerStreamingCall.
Define a server-streaming method in proto/echo.proto and build the descriptor set:
syntax = "proto3";
package example.v1;
service Echo {
rpc Echo(EchoMessage) returns (EchoMessage);
rpc Watch(EchoMessage) returns (stream EchoMessage);
}
message EchoMessage {
string text = 1;
}buf build proto --as-file-descriptor-set -o api.binpbHandle unary and server-streaming calls in grpc.php by passing a \Generator to ServerStreamingCall::respond():
<?php
use Rapira\Exception\ClosedException;
use Rapira\Exception\WorkDiscardedException;
use Rapira\Grpc\ServerStreamingCall;
use Rapira\Grpc\UnaryCall;
$dispatcher = Rapira\get_dispatcher();
try {
while (true) {
$call = $dispatcher->receive();
try {
if ($call instanceof ServerStreamingCall) {
$call->getResponseMetadata()->addHeader('x-stream', '1');
$call->respond((static function (string $request): \Generator {
for ($i = 0; $i < 3; $i++) {
yield $request;
}
})($call->getMessage()));
} elseif ($call instanceof UnaryCall) {
$call->respond($call->getMessage());
}
} catch (WorkDiscardedException) {
continue;
}
}
} catch (ClosedException) {
return;
}You can load [grpc].descriptor_set from an http:// or https:// URL at startup. The auth interceptor checks bearer tokens with constant-time SHA-256 comparison:
[grpc]
listen = "127.0.0.1:50051"
descriptor_set = "https://schemas.example.com/echo/v1/api.binpb"
reflection = true
interceptors = ["auth"]
[grpc.auth]
tokens_file = "grpc-tokens"
[grpc.pool]
entrypoint = "grpc.php"
mode = "dispatcher"
workers = 2Test the streaming endpoint with grpcurl:
grpcurl -plaintext -H 'authorization: Bearer ci.deploy-token' -d '{"text":"hello"}' 127.0.0.1:50051 example.v1.Echo/WatchSee Server-streaming calls, Load the descriptor set from a URL, and Authentication.
Packing applications with rapira pack and /app VFS
#
Major feature
rapira pack embeds your PHP application, rapira.toml, and an optional php.ini into a 64-bit Linux ELF or macOS Mach-O rapira executable.
Pack an application directory, then run the output binary directly from memory:
rapira pack . -o dist/my-app --php-ini php.ini
./dist/my-appCombine a static Linux binary with --base to create one self-contained executable with PHP and your application embedded:
rapira pack . -o dist/my-app --base ./rapira-v0.10.0-php8.6-linux-x86_64-static/bin/rapira
./dist/my-appIn-memory /app VFS requires PHP 8.5 or newer
On PHP 8.5 and PHP 8.6, the packed executable mounts your files read-only in memory at /app without extracting files. It supports PHP streams, stat, glob, SplFileInfo, SplFileObject, opcache.preload, open_basedir, static files, and Exchange::sendFile().
On PHP 8.4, or when an application needs files on disk, extract the bundle once with --extract-dir or RAPIRA_EXTRACT_DIR:
./dist/my-app --extract-dir /var/cache/my-appSee Packing an application, In-memory /app VFS, and Extract to disk.
Single-process ZTS runtime and pool controls # Major feature
v0.10 adds pool environment variables, CPU execution clocks, boot failure backoff, live object inspection, and coordinated OPcache reloads.
Configure pool environment variables, CPU time measurement, and boot limits in rapira.toml:
[server]
pidfile = "/run/rapira.pid"
stop_timeout_secs = 30
[http]
listen = "127.0.0.1:8000"
[http.pool]
entrypoint = "public/index.php"
mode = "worker"
workers = 4
execution_clock = "cpu"
max_boot_failures = 5
request_terminate_timeout_secs = 30
[http.pool.env]
APP_ENV = "prod"
APP_DEBUG = "0"Inspect live PHP objects in Worker or Dispatcher mode without adding strong references:
$counts = \Rapira\count_objects();
\Rapira\log('live objects', \Rapira\LogLevel::Info, [
'orders' => $counts[App\Order::class] ?? 0,
]);
$instances = \Rapira\get_objects([App\Order::class]);
foreach ($instances as $order => $_) {
// Inspect each retained object weakly.
}On Linux and macOS, switch a symlinked deployment release and reload every pool with coordinated OPcache resets:
ln -sfn /srv/releases/2026-12-03 /srv/current
kill -HUP "$(cat /run/rapira.pid)"See Process model, The [http.pool] table, and Exit codes.
HTTP compression middleware and I/O performance #
HTTP connections run on dedicated single-threaded LocalSet I/O shards with streaming multipart parsing and zero-copy raw body chunks.
Enable built-in zstd and gzip response compression with "compress" in http.middleware:
[http]
listen = "127.0.0.1:8000"
middleware = ["compress", "static"]
[http.compress]
min_size = 1024
gzip_level = 4
zstd_level = 3
[http.static]
root = "public"
forbid = [".php"]Put "compress" before "static" in http.middleware to compress both static files and PHP responses.
Verify compression with curl:
curl -i -H 'Accept-Encoding: zstd, gzip' http://127.0.0.1:8000/app.jscurl.exe -i -H "Accept-Encoding: zstd, gzip" http://127.0.0.1:8000/app.jsThe static middleware shares its file cache across the server process and detects atomic renames by file identity. It also confines symbolic links inside the configured static root on both disk and /app VFS.
See The [http.compress] table, HTTP requests and responses, and Static files.
Static Linux binaries, Distroless images, and PHP 8.6 #
v0.10 adds PHP 8.6 builds and static single-binary Linux tarballs (-static.tar.gz for PHP 8.5 and 8.6). It also ships non-root Distroless container images on gcr.io/distroless/cc-debian13:nonroot. Container images rebuild automatically when the official PHP or Distroless base images update.
Download and verify a static Linux binary:
curl -LO https://github.com/rapira-rs/rapira/releases/download/v0.10.0/rapira-v0.10.0-php8.6-linux-x86_64-static.tar.gz
curl -LO https://github.com/rapira-rs/rapira/releases/download/v0.10.0/rapira-v0.10.0-SHA256SUMS.txt
sha256sum -c --ignore-missing rapira-v0.10.0-SHA256SUMS.txt
tar xzf rapira-v0.10.0-php8.6-linux-x86_64-static.tar.gz
./rapira-v0.10.0-php8.6-linux-x86_64-static/bin/rapira --versionRun an application in a read-only Distroless container:
FROM ghcr.io/rapira-rs/rapira:php8.6 AS builder
WORKDIR /src
COPY . /src
RUN rapira pack /src -o /usr/local/bin/my-app
FROM ghcr.io/rapira-rs/rapira:php8.6-distroless
COPY --from=builder /usr/local/bin/my-app /usr/local/bin/my-app
ENTRYPOINT ["/usr/local/bin/my-app"]
CMD []docker build -t my-app .
docker run --init --read-only --tmpfs /tmp:rw,mode=1777 -p 8000:8000 my-appSee Static Linux binaries, Distroless, and Download.
Earlier releases #
- v0.9.2 (2026-11-01): App recycling at
max_requestsand on reload,HttpDispatcherInfo::serverName()andserverPort(), HTTP/gRPC drain fixes, and the Sodium extension. Read the Rapira 0.9.2 post. - v0.9.1 (2026-10-07): Fixed
isCancelled()andisFinalized()crashes in x86-64 release builds and HTTP/1.1Transfer-EncodingandConnectionheader handling. - v0.9.0 (2026-10-05): Independent HTTP and gRPC worker pools, unary gRPC/gRPC-Web/Connect plugin with bearer-token auth, Prometheus
/metrics,/livezand/readyzprobes, and bundled PHP extensions. - v0.8.1 (2026-09-05): Improved HTTP connection distribution across workers on Linux.
- v0.8.0 (2026-09-02): Hyper and Tower HTTP/1.1 server,
\Rapira\Moderuntime API, and static file serving with an in-memory cache.