Skip to content
 

Introduction

ePHPm is an all-in-one PHP application server written in Rust. It embeds PHP via FFI into a single binary alongside an HTTP server, database layer (MySQL/PostgreSQL-compatible wire protocol over SQLite), KV store, gossip clustering, and ACME TLS. The same binary runs on your laptop, in CI, and in production.

If you want to actually run something, jump to Getting Started.

Comparison

How ePHPm compares to other ways of running PHP with a webserver.

ePHPmFrankenPHPRoadRunnerSwooleApache + mod_phpNginx + php-fpm
LanguageRustGo (CGO)GoPHP + CCC
Dispatch to PHP<1 μs (in-process C call)~2–3 μs (CGO crossings)~10–50 μs (IPC to worker)<1 μs (in-process)<1 μs (in-process)~50–100 μs (FastCGI socket)
Server GC pausesNoneGo GCGo GCNoneNoneNone
BinarySingle static binaryCaddy moduleGo binary + PHP workersPHP + extensionApache + modulesNginx + separate FPM
DB proxy + connection poolingBuilt-in (MySQL wire, R/W split)NoNoNoNoNo
Embedded DBSQLite via litewireNoNoNoNoNo
Built-in KV storeYes (RESP compatible, in-process)NoNoNoNoNo
Query stats (Prometheus)Built-inNoNoNoNoNo
Auto TLS (ACME)Built-inVia CaddyNoNoNoNo
ClusteringGossip (SWIM)NoNoMulti-process (single node)NoNo
Virtual hostsBuilt-in (directory-based)Via CaddyNoNo<VirtualHost>server blocks
Install size~40 MB (varies by PHP extensions)~150 MB~60–70 MB (rr + PHP)~35–45 MB (PHP + .so)~50–60 MB (Apache + PHP)~40–50 MB (Nginx + PHP)
PHP compatibilityDrop-inDrop-inDrop-in (worker mode requires PSR-7)Drop-in (async features require rewrite)Native (100%)Native (100%)
DeploymentSingle binaryRequires CaddyMulti-processRequires PHP + Swoole extensionApache + modulesSeparate services
Container-friendly✓ (single binary)✓ (Caddy module)⚠️ (PHP + extension)⚠️ (heavier)⚠️ (two services)

For a deeper look at each alternative, see the Analysis section.