Boost PHP Performance with FrankenPHP: A Fast, Low‑Resource Runtime

FrankenPHP is a high‑performance PHP runtime built on the Caddy web server that embeds the PHP interpreter, offering faster request handling, lower resource usage, and seamless compatibility with popular PHP frameworks, plus simple Docker‑based deployment.

Open Source Tech Hub
Open Source Tech Hub
Open Source Tech Hub
Boost PHP Performance with FrankenPHP: A Fast, Low‑Resource Runtime

Overview

FrankenPHP is a high‑performance PHP application runtime and server built on Caddy, combining the PHP interpreter with the Go‑based Caddy server.

Key Features

Based on Caddy and Go : leverages Caddy’s modular architecture and Go’s concurrency for stable HTTP/2 and HTTP/3 support.

Integrated PHP runtime : embeds the PHP interpreter, reducing the overhead of traditional PHP‑FPM process management.

High performance : pre‑loading, OPcache optimizations and fewer context switches boost request handling speed.

Developer‑friendly : compatible with existing PHP frameworks (ThinkPHP, Laravel, Symfony, etc.) and offers two modes—classic (similar to FPM) and worker (resident memory) with minimal code changes.

Comparison with PHP‑FPM

FrankenPHP embeds PHP in a single binary and runs on Go coroutines, whereas PHP‑FPM uses a separate FastCGI process manager. FrankenPHP provides higher throughput, lower latency, native HTTP/1.1‑2‑3 support, and simpler deployment (single binary) compared with the need to configure Nginx/Apache for PHP‑FPM.

Typical Use Cases

API / micro‑services: faster response under high concurrency.

Accelerating traditional apps: improves performance of WordPress, Shopify, etc.

Serverless / edge computing: lightweight design fits cloud‑native deployments.

Installation

Download the binary or Docker image from https://frankenphp.dev/. Binary installation example:

curl https://frankenphp.dev/install.sh | sh
mv frankenphp /usr/local/bin/

Run directly in a PHP project directory:

frankenphp php-server   # start server
frankenphp php-cli /path/to/script.php   # execute a script

Quick Start Example

Create index.php with a simple echo, then run a Docker container:

docker run -v .:/app/public -p 80:80 -p 4433:443 dunglas/frankenphp

Access https://localhost:4433/ to see the output “FrankenPHP 开源技术小栈!”.

Running ThinkPHP 8 with FrankenPHP

Install ThinkPHP 8 via Composer, add a controller, and configure a Caddyfile to route requests to the PHP server. Example Caddyfile snippet:

:80 {
    root * /app/public
    encode zstd br gzip
    php_server {
        env PATH_INFO {http.matchers.file.remainder}
        try_files {path} index.php/{path}
    }
    log {
        output file /app/runtime/log/caddy.log
        level DEBUG
    }
}

Start the container with the Caddyfile mounted, then access http://127.0.0.1 to receive “Hi ThinkPHP8” and http://127.0.0.1/index/hello?name=Tinywan to receive “hello,Tinywan”.

PerformanceDockerbackend developmentCaddyFrankenPHP
Open Source Tech Hub
Written by

Open Source Tech Hub

Sharing cutting-edge internet technologies and practical AI resources.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.