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.
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
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
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.
Key features
- Compatible with classic nginx
try_files - Configuration through environment variables
- Static file caching and compression, on by default
- Dot-path blocking
- Trusted proxies
.oxphpdenypath deny rules- RFC compliance
-
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.6 | all | 8.2+ | 8.1+ |
| Language | Rust + C | C | Go + C | Go |
| TLS 1.3 | ✓ (rustls) | ✓ | ✓ | ✓ |
| Persistent worker state | ✓ | — | ✓ | ✓ |
| Backpressure / HTTP 529 | built-in | manual | — | — |
| Prometheus metrics | built-in | plugin | built-in (Caddy admin) | built-in plugin |
| Structured JSON logs | built-in | via log_format | ✓ | ✓ |
| WebSocket server | — | ✓ (proxies) | ✓ (proxies) | ✓ (centrifuge plugin) |
| Reverse proxy / upstream | — | ✓ (full-featured) | ✓ (Caddy) | — |
| Native install (non-Docker) | — | apt/yum/brew/port | brew, static binary | brew, binary |
| Platforms (runtime) | Linux only (glibc/musl) | Linux/BSD/Mac | Linux/Mac/Win | Linux/Mac/Win |
| License | AGPL-3.0 | BSD-2 / PHP License | MIT | MIT |
| Age / production track record | <1 year | 20+ years | 3+ years | 7+ years |