Introduction
FrankenPHP is a modern application server for PHP built on top of Caddy. It embeds PHP directly into the web server as a Go module, eliminating the need for PHP-FPM. This architecture enables features like worker mode for persistent applications, HTTP/3 support, early hints (103), and automatic HTTPS out of the box.
What FrankenPHP Does
- Serves PHP applications without requiring PHP-FPM or a separate process manager
- Provides worker mode that keeps PHP scripts in memory between requests
- Handles HTTPS certificates automatically via Caddy integration
- Supports HTTP/2 and HTTP/3 (QUIC) natively
- Enables 103 Early Hints for faster page loads
Architecture Overview
FrankenPHP embeds the PHP interpreter as a Go module inside Caddy. When a request arrives, Caddy routes it to the embedded PHP runtime, avoiding the overhead of FastCGI communication. In worker mode, a PHP script boots once and handles multiple requests from memory, similar to how application servers work in other languages.
Self-Hosting & Configuration
- Run via the official Docker image or download a standalone static binary
- Configure with a Caddyfile or use the default settings for zero-config operation
- Enable worker mode by specifying a worker script (e.g., Laravel or Symfony entry point)
- Set environment variables for PHP configuration (memory limit, extensions, etc.)
- Deploy behind a load balancer or use Caddy's built-in clustering for high availability
Key Features
- Worker mode keeps applications in memory for significant performance gains
- Automatic HTTPS with Let's Encrypt and ZeroSSL certificate provisioning
- Native HTTP/3 and 103 Early Hints support without extra configuration
- Single binary deployment with no PHP-FPM, nginx, or Apache required
- Full compatibility with existing PHP frameworks (Laravel, Symfony, WordPress)
Comparison with Similar Tools
- PHP-FPM + Nginx — Traditional setup requiring multiple processes; FrankenPHP is a single binary
- Swoole — PHP extension for async processing; FrankenPHP keeps standard PHP compatibility
- RoadRunner — Go-based PHP app server; FrankenPHP embeds PHP in Caddy with native HTTPS
- OpenLiteSpeed — High-performance web server with PHP support; FrankenPHP has simpler setup
- Laravel Octane — Framework-level worker mode; FrankenPHP works with any PHP application
FAQ
Q: Is FrankenPHP compatible with my existing PHP application? A: Yes. Standard PHP applications work without modification. Worker mode may require minor adjustments for stateful resources.
Q: How does worker mode improve performance? A: Worker mode boots your application once and handles multiple requests without re-initializing the framework, reducing response times significantly.
Q: Does FrankenPHP support PHP extensions? A: Yes. The Docker image includes common extensions, and you can compile custom builds with additional extensions.
Q: Can I use FrankenPHP in production? A: Yes. FrankenPHP is production-ready and used by organizations running Laravel, Symfony, and other PHP frameworks at scale.