gitmyhub

frankenphp

Go ★ 11k updated 6d ago

🧟 The modern PHP app server

FrankenPHP replaces Nginx and PHP-FPM with a single binary that serves PHP apps with automatic HTTPS, HTTP/2, and a worker mode that keeps Laravel or Symfony loaded in memory between requests.

GoPHPsetup: easycomplexity 3/5

FrankenPHP is an application server for PHP, the programming language used to build websites like WordPress, Laravel apps, and Symfony projects. Most PHP setups require multiple separate pieces working together: a web server like Nginx, a PHP processor called PHP-FPM, and manual configuration to connect them. FrankenPHP replaces that entire stack with a single binary.

It is built on top of Caddy, a web server written in Go that handles HTTPS certificates automatically. Because of this, FrankenPHP provides automatic HTTPS right out of the box, along with support for HTTP/2 and HTTP/3, which are newer and faster versions of the web protocol. It also supports a worker mode that keeps your PHP application loaded in memory between requests, which can significantly speed up frameworks like Laravel and Symfony that normally reload from scratch on every request.

You can install FrankenPHP as a standalone binary on Linux, macOS, or Windows, and it comes bundled with PHP 8.5 and the most commonly used PHP extensions. No separate PHP installation is required on Linux. Package manager options (apt, dnf, apk, Homebrew) are available, as are Docker images.

To start serving a PHP project, you run a single command in your project folder. For existing projects built on Symfony, Laravel, WordPress, Drupal, Joomla, or Magento, there are integration guides covering how to switch from a traditional Nginx and PHP-FPM setup.

FrankenPHP can also function as a Go library, meaning developers who build applications in Go can embed PHP directly into their programs.

Where it fits