Supercharge Your PHP Apps with FrankenPHP Classic Mode
PHP deployment hasn't seen a shift this exciting in years. FrankenPHP is here, and while everyone talks about "worker mode", Classic Mode is the immediate upgrade your servers need.
I've written a comprehensive guide on how to replace PHP-FPM with FrankenPHP behind Nginx.
What is Classic Mode?
It allows FrankenPHP to act as a standard request handler, just faster and simpler than FPM. It integrates perfectly with your existing Nginx setups.
Why it's better:
- 103 Early Hints: Speeds up perceived load times by sending assets before the page is ready.
- Observability: Detailed Prometheus metrics and structured logging out of the box.
- Robustness: Benefits from Go's memory safety for the server layer.
Static vs Dynamic (Glibc) Builds
One of huge advantages of FrankenPHP is the static build.
- Static: Zero dependencies. Runs on Alpine, Debian, CentOS without needing libraries like
libpnginstalled. Perfect for containers. - Dynamic: Uses system libraries. Better if you need specific system-patched versions of libs.
The Tool
I also released an open-source tool, frankenphp-classic-setup, which automates:
- Binary installation (smartly chooses Static or Dynamic based on need).
- Systemd service creation.
- Nginx configuration generation.
- CLI wrapper setup (use
fphpinstead ofphp).
The Guide
I cover the manual "hard way" to help you learn, and the automated "easy way" to get you into production fast.
Manual Steps Summary
- Download
frankenphp. - Set up a systemd service pointing to your doc root.
- Proxy Nginx to port 9000.
Automated Way
git clone https://github.com/iperamuna/frankenphp-classic-setup.git
sudo ./setup.sh
Read the full technical breakdown and guide here
About the Author
Indunil Peramuna is a software engineer passionate about optimizing modern web infrastructure.
- GitHub: @iperamuna
- LinkedIn: indunilperamuna
- Telegram: @iperamuna
- Discord: iperamuna
- WhatsApp: +94777671771

Top comments (1)
Thanks. We currently use fpm on a website with 4000 requests/sec and 10 million daily unique users, so having an alternative on the back burner in case it causes problems at some point is good.