HeadlinesBriefing favicon HeadlinesBriefing.com

FrankenPHP Classic Mode Boosts PHP Apps

DEV Community •
×

PHP developers have a new tool to enhance their applications' performance with FrankenPHP Classic Mode. Unlike the much-talked-about worker mode, Classic Mode offers an immediate upgrade by acting as a faster, simpler request handler than the traditional PHP-FPM. This mode integrates seamlessly with existing Nginx setups, providing a straightforward path to improved server efficiency.

The guide, written by Indunil Peramuna, a software engineer focused on modern web infrastructure, details how to replace PHP-FPM with FrankenPHP. The mode offers several advantages, including 103 Early Hints to speed up perceived load times, enhanced observability with Prometheus metrics and structured logging, and increased robustness due to Go's memory safety features. One of the standout features of FrankenPHP is its static build, which offers zero dependencies and runs on a variety of operating systems like Alpine, Debian, and CentOS without additional libraries.

This is particularly advantageous for containerized environments. Alternatively, a dynamic build that uses system libraries is available for those needing specific system-patched versions. To facilitate easy adoption, Peramuna has released an open-source tool, `frankenphp-classic-setup`, which automates the installation process.

This includes binary installation, systemd service creation, Nginx configuration, and setting up a CLI wrapper for easier command execution. The guide offers both a manual setup for those who prefer a hands-on approach and an automated method for quicker implementation. By following these steps, developers can significantly improve their PHP application's performance and reliability.