frankenphp Documentation

The modern PHP app server

11,191 stars Go Go 1 file ยท ~1,227 tokens #caddy#frankenphp#go#php#sapi#worker
RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy frankenphp on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name frankenphp -p 80:80 --restart always php/frankenphp:latest

FrankenPHP

FrankenPHP is a modern PHP application server written in Go and powered by Caddy. It runs PHP applications with automatic HTTPS, HTTP/2 and HTTP/3, an in-memory worker mode, real-time updates via Mercure, hot reload, and a static-binary deployment story.

This index points AI agents and crawlers at the canonical English documentation. All URLs are absolute. Each Markdown source file carries SEO and LLM-friendly YAML frontmatter (title, description).

Core concepts

  • FrankenPHP Classic Mode: drop-in replacement for PHP-FPM and Apache mod_php using a fixed or autoscaling thread pool.
  • FrankenPHP Worker Mode: keep your PHP application bootstrapped in memory between requests for lower latency.
  • Configuring FrankenPHP: Caddyfile, JSON, environment variables, and php.ini configuration.
  • FrankenPHP Internals: thread types, the state machine, the Go/C/PHP CGO boundary, auto-scaling, and per-thread environment sandboxing.
  • FrankenPHP Security Model: trust boundaries between Go, C, and PHP (which inputs are untrusted, what the runtime is responsible for, and what is out of scope).

Setup and build

Worker mode and extensions

  • FrankenPHP Worker Mode: supervisor configuration, restart policies, and integration with Symfony Runtime and Laravel Octane.
  • Extension Workers: dedicated PHP thread pool from a Go extension for queues, schedulers, and event listeners.
  • Writing PHP Extensions in Go: extension generator, types API, calling PHP from Go, classes, methods, and constants.

Frameworks

Real-time and performance features

Production and observability

Project