The modern PHP app server, written in Go.
One binary that boots your app once and keeps it alive. Worker mode, automatic HTTPS, HTTP/3 and Early Hints, stitched together on top of Caddy.
curl https://frankenphp.dev/install.sh | shFree and open source. Runs on Linux, macOS, Windows and FreeBSD.
One command to run them all.
A production-grade PHP server in one command. No PHP-FPM, no Nginx, no glue: copy your PHP files into the document root and you're done.
# Install FrankenPHP on Linux or macOS
curl https://frankenphp.dev/install.sh | sh
# Or on Windows, with PowerShell
irm https://frankenphp.dev/install.ps1 | iex
# Serve the public/ directory
frankenphp php-server -r public/# Serve the public/ directory
docker run -v $PWD:/app/public \
-p 443:443/tcp -p 443:443/udp \
dunglas/frankenphp
# Run a command-line script
docker run -v $PWD:/app \
dunglas/frankenphp php script.phpAnatomy of a modern PHP server.
Every part was stitched on for a reason. Here's what keeps the creature alive.
The bolts
Automatic HTTPS
Certificates issued, renewed and revoked for you, with Let's Encrypt or ZeroSSL.
The brain
Worker mode
Boots your app once and keeps it in memory, ready in milliseconds.
The stitches
Caddy inside
The official PHP executor sewn into Caddy, with every Caddy module at hand.
One binary. No PHP-FPM.
Boot it once.
It stays alive.
Worker mode boots your application a single time and keeps it in memory. Every request after that skips the bootstrap, using plain old superglobals: no PSR-7 required.
faster than PHP-FPM on API Platform apps, according to our benchmarks.
public/index.php
<?php
// Boot your app once
require __DIR__.'/vendor/autoload.php';
$app = new \App\Kernel();
$app->boot();
$handler = static function () use ($app) {
echo $app->handle($_GET, $_POST, $_COOKIE, $_FILES, $_SERVER);
};
// …then serve request after request
while (\frankenphp_handle_request($handler)) {
gc_collect_cycles();
}Straightforward
Supported natively by Laravel Octane, Symfony and API Platform.
Efficient
Written in Go and C, built on Go's iconic goroutines.
Optional
Apps that aren't worker-ready are served as-is, in classic mode.
Easy deploy
Runs in process: one binary, no external service needed.
Watcher
Workers restart automatically each time your code changes.
Self-healing
Restart a worker after N requests to keep memory leaks in check.
Caddyfile
localhost {
# Enable compression (optional)
encode zstd br gzip
# Execute PHP files and serve assets
php_server
}Three lines. Production-grade.
That's all it takes to run a production-grade PHP server, powered by Caddy.
- HTTPS ✓
- HTTP/3 ✓
- zstd · br · gzip ✓
- Early Hints ✓
Everything else, in the box.
Only one service
No PHP-FPM: FrankenPHP uses its own SAPI, handcrafted for Go web servers.
Extensible
PHP 8.2+, most PHP extensions and all Caddy modules. Write extensions in Go, too.
Easy deploy
A Docker image, Kubernetes, or your whole app as one static binary.
Worker mode
Boot once, then answer each request in a few milliseconds.
103 Early Hints
The only PHP SAPI with Early Hints, for pages that start loading sooner.
Real-time
A built-in Mercure hub sends events from PHP to every browser.
Modern compression
Zstandard, Brotli and gzip, supported out of the box.
Structured logging
Logs with a defined format and the details you need.
Metrics & tracing
Built-in Prometheus support, with no extra service to run.
HTTP/2 & HTTP/3
Native support for HTTPS, HTTP/2 and HTTP/3.
HTTPS automation
Certificates generated, renewed and revoked automatically.
Graceful reload
Deploy with zero downtime thanks to graceful reloads.
Born in a lab. Written in Go.
FrankenPHP is a Caddy module and a library: embed the PHP interpreter in any Go program and serve PHP scripts through net/http.
server, _ := frankenphp.NewServer("public/")
frankenphp.Init(frankenphp.WithServer(server))
defer frankenphp.Shutdown()
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
server.ServeHTTP(w, r)
})Moderner PHP than ever!
- Runs the official PHP interpreter inside Caddy, a state-of-the-art web server.
- Supports HTTP/1.1, HTTP/2 and HTTP/3 natively, with automatic HTTPS certificates.
- Copy your PHP files into the document root, and you're done.
- Builds standalone, self-executable binaries of your web apps and CLI tools.
- Works out of the box with popular extensions, including OPcache and Xdebug.
Need a hand? We've got heart.
Les-Tilleuls.coop, the cooperative behind FrankenPHP, helps teams migrate, host and speed up their PHP apps.