Multithreaded PHP application server for cloud infrastructure

One process instead of a stack: HTTP/2, TLS, static files and PHP workers run in one binary as threads sharing one OPcache. Built-in metrics, tracing and per-request profiling.

v0.16.0evaluation preview

Dockerfile
FROM ghcr.io/oxphp/oxphp:0.16.0COPY --chown=www-data:www-data . /var/www/html/public
docker build -t app . && docker run -p 80:80 app

Copy your application into the image and run it. Docker Guide

Docs your coding agent can read

Every page on this site is also plain Markdown: add .md to its address. Give your agent the index or connect it over MCP, and it works from the real documentation instead of guessing API names from stale training data.

MCP server

Three read-only tools: list_docs, read_doc and list_config. Public and anonymous, with no API key and no login.

https://oxphp.dev/mcp
Connect your agent

llms.txt

A plain-text list of every documentation page, with a one-line description and a link to its Markdown.

https://oxphp.dev/llms.txt
Open llms.txt

How OxPHP works

A PHP request waits in a bounded queue for a free worker, and each worker is a dedicated OS thread. Closures passed to oxphp_async() run on a pool of their own, so long tasks don't hold up the workers answering requests.

Client
Async HTTP serversingle- or multi-threaded
Route dispatch
static
Static fileLRU cache
PHP
Bounded queue529 on wait timeout
miss
404 Not Found
PHP workersdedicated OS threads
Worker
Worker
Worker
Async pooloxphp_async / oxphp_async_await
Async workersdedicated OS threads
Worker
Worker
Worker
Client
Async HTTP serversingle- or multi-threaded
Route dispatch
static
Static fileLRU cache
miss
404 Not Found
PHP
Bounded queue529 on wait timeout
PHP workersdedicated OS threads
Worker
Worker
Worker
Async pooloxphp_async / oxphp_async_await
Async workersdedicated OS threads
Worker
Worker
Worker
Architecture overview

Key features

All features
  • Worker mode

    PHP workers stay alive between requests, so autoloaders, containers and DB connections initialize once.

  • Fiber multiplexing

    Each worker handles multiple concurrent requests via Fibers; sleeps and awaits yield instead of blocking.

  • Async promises

    Closures run in parallel on a separate thread pool, combined with all, race and any.

  • Shared state

    Counters, atomics, channels, maps and pools shared across workers, with microsecond operations instead of Redis round-trips.

  • Built-in observability

    Prometheus metrics, OpenTelemetry traces and APM auto-instrumentation of PDO, cURL and Redis, with no code changes.

  • Built-in profiler

    Per-request profiles in xhprof and FlameGraph formats, triggered by a header, by sampling or from your code.

Compared to the alternatives

OxPHP is under active development and not yet production-ready, but it is ready for evaluation, staging and early adopters. The migration guide covers what changes when you switch from each server in the table.

OxPHP nginx+FPM FrankenPHP RoadRunner
Supported PHP versions 8.4, 8.5 and 8.6all8.2+8.1+
Language Rust + CCGo + CGo
TLS 1.3 ✓ (rustls)✓✓✓
Persistent worker state ✓—✓✓
Backpressure / HTTP 529 built-inmanual——
Prometheus metrics built-inpluginbuilt-in (Caddy admin)built-in plugin
Structured JSON logs built-invia log_format✓✓
WebSocket server —✓ (proxies)✓ (proxies)✓ (centrifuge plugin)
Reverse proxy / upstream —✓ (full-featured)✓ (Caddy)—
Native install (non-Docker) —apt/yum/brew/portbrew, static binarybrew, binary
Platforms (runtime) Linux only (glibc/musl)Linux/BSD/MacLinux/Mac/WinLinux/Mac/Win
License AGPL-3.0BSD-2 / PHP LicenseMITMIT
Age / production track record <1 year20+ years3+ years7+ years