Skip to content

RestPHPThe Blazing-Fast PHP Runtime

PHP runtime powered by Rust with a custom Zend SAPI bridge, boot-once callbacks, and one NTS worker per process.

$curl -fsSL https://restphp.dev/install.sh | bash
info Downloading restphp v0.1.0 (x86_64-unknown-linux-gnu)...
✓ Verified binary signature & checksums
✓ Installed executable to /usr/local/bin/restphp
Run "restphp --help" to explore commands.

Serving a Laravel 11 Application

JSON API endpoint · 1,000 concurrent connections · 64 vCPU AMD EPYC · medians of 5

Requests per second · higher is better
RestPHPv0.1.0 (Rust)
52,410 req/s🔥 1st Place
Swoolev5.1 (C++)
46,820 req/s
FrankenPHPv1.4 (Go)
38,150 req/s
RoadRunnerv2024 (Go)
34,200 req/s
Nginx + PHP-FPM8.4 NTS
4,200 req/s
015k30k45k60k req/s

The fastest server in every situation you actually hit.

Cold boot, warm cache, peak concurrency, tail latency — measured six ways against FrankenPHP, RoadRunner, Swoole, and Nginx+FPM at their defaults.

1. Cold Boot / Startup

Process execution to first HTTP 200 response

RestPHP1.4 ms
FrankenPHP45 ms
RoadRunner60 ms
Nginx + PHP-FPM450 ms

2. Warm Persistent Traffic

Zend VM kept hot in RAM · Plaintext echo

RestPHP42,223 req/s
FrankenPHP38,100 req/s
RoadRunner34,200 req/s
Nginx + PHP-FPM2,500 req/s

3. Real JSON API Payload

Routing + dynamic json_encode serialization

RestPHP33,728 req/s
FrankenPHP31,500 req/s
RoadRunner28,000 req/s
Nginx + PHP-FPM2,100 req/s

4. Tail Latency p99

99th percentile under continuous 50 concurrency

RestPHP1.41 ms
FrankenPHP4.80 ms
RoadRunner5.60 ms
Nginx + PHP-FPM42.0 ms

5. Peak RAM Under Load

Resident Set Size (RSS) under 50k requests

RestPHP19.8 MB
RoadRunner58.0 MB
FrankenPHP68.0 MB
Nginx + PHP-FPM140.0 MB

6. Heavy Compute Workload

CPU-intensive recursive algorithm in PHP

RestPHP3,760 req/s
FrankenPHP3,400 req/s
RoadRunner3,100 req/s
Nginx + PHP-FPM380 req/s
Linux x64, Debian 13 (Proxmox KVM) · wrk 4.1.0 · PHP 8.4.24 NTS · medians of 3 runs · reproduce the benchmark →

Core Pillars & Capabilities ​

Zero-Cost C-FFI

Zero-Cost C-FFI

Directly embeds Zend Engine via raw C-ABI (extern "C"). Eliminates ~60ns cgo stack-switching overhead present in Go-based servers.

Zero Host Garbage Collection

Zero Host Garbage Collection

Rust compile-time ownership (RAII) manages host memory without a host garbage collector.

Persistent Worker Architecture

Persistent Worker Architecture

One dedicated worker thread hosts the current NTS PHP runtime. Scale with supervisor-managed processes.

Laravel runtime status

Laravel support

Serve public/index.php with per-request teardown, or boot Laravel once through the restphp/octane adapter and Octane request sandboxes.

Single Standalone Binary

Single Standalone Binary

Shipped as a single static executable (restphp). No Nginx, PHP-FPM, or Caddy configuration required.

Native Zend embedding

Native Zend embedding

RestPHP embeds the Zend engine directly; a production extension compatibility matrix is in progress.


One Minute with RestPHP ​

Install, build, and serve any PHP application in seconds:

bash
# Just run restphp — auto-detects Laravel, public/index.php, or index.php!
restphp
bash
# Execute PHP code directly in-memory from terminal
restphp -e 'echo "PHP Version: " . PHP_VERSION . "\n";'

Architecture Overview ​


Architectural Comparison ​

How does RestPHP's architecture differ from Go and C++ alternatives?


Ready to build the future of PHP? ​

Join the revolution. Say goodbye to slow cold boots and unpredictable GC pauses.

Get Started with RestPHP →View Source on GitHub ★

Released under the MIT / Apache-2.0 License. Powered by Rust & Zend Engine.