FrankenPHP
In this post, we'll be looking at FrankenPHP. A modern, high-performance PHP application server and runtime designed to serve PHP applications without relying on traditional web servers like Apache or Nginx. It aims to simplify PHP deployment while improving performance, especially for modern apps like those using Laravel or Symfony.
π§ What is FrankenPHP?
FrankenPHP is:
A PHP web server: It can run your PHP code directly.
Built with Caddy: A popular Go-based web server known for its simplicity and automatic HTTPS support.
Embedded PHP: It embeds the PHP engine in the web server itself, eliminating the need for
php-fpm.Async / Worker-Friendly: It supports long-running worker processes (like Laravel Octane), WebSockets, HTTP/2, and Server-Sent Events out of the box.
π‘ Why Use FrankenPHP?
| Traditional Stack | FrankenPHP |
|---|---|
| Nginx/Apache + PHP-FPM | Just FrankenPHP (no FPM needed) |
| Separate server config | Everything in one place |
| Manual HTTPS setup | Automatic HTTPS via Caddy |
| Slow cold starts (FPM) | Persistent workers = faster apps |
| Harder async/WebSocket setup | Native support |
π οΈ Use Cases
Laravel, Symfony, or WordPress hosting
Server-Sent Events (SSE) or WebSockets
Microservices or APIs
Running PHP without setting up Nginx or Apache
Building Docker images for PHP easily
π Key Features
β Native HTTP server (via Caddy)
β Runs PHP scripts directly
β Async features (e.g., SSE, WebSockets)
β Better performance (persistent workers)
β Compatible with PHP frameworks
β Docker-ready
β Automatic HTTPS with Let's Encrypt
π How It Works (Simply)
Caddy handles HTTP requests.
PHP is embedded directly in Caddy.
Your PHP code runs immediately, without needing to be passed through FPM or another proxy.
FrankenPHP manages lifecycle, workers, and memory, letting you keep services running across requests if needed.
π³ Example Docker Usage
π Getting Started
Official site: https://frankenphp.dev
GitHub repo: https://github.com/dunglas/frankenphp
Install via Docker, or build from source.
π FrankenPHP vs Laravel Octane?
Octane requires Swoole or RoadRunner.
FrankenPHP works out-of-the-box, no PHP extensions or extra tools.
Both enable persistent workers and speed improvements.


Comments