The Single Binary for CLI and FPM RFC adds a build option that links PHP's FPM SAPI into the CLI executable. One binary can then run normal command-line scripts and PHP-FPM. That can cut package size and reduce cold-start work on platforms such as AWS Lambda.

One executable for both jobs

Build PHP with the new option alongside the CLI and FPM SAPIs:

./configure --enable-cli --enable-fpm --enable-cli-fpm

The resulting php executable starts FPM when its first argument is --fpm. It also starts FPM when called through a name beginning with php-fpm, such as a php-fpm8.7 symlink. Existing CLI commands continue to work as before.

php script.php                               // CLI
php --fpm --nodaemonize -y /etc/php-fpm.conf // FPM

The RFC reports an 18% reduction in a zipped Bref Lambda layer and a 28% reduction after unzipping. The combined executable grew by 138 KB in the measured build. In a cold-start test that ran FPM after a CLI bootstrap, the median duration fell from 280 ms to 211 ms. The test measured PHP 8.5.11 on Linux x86-64, so other platforms may see different results.

What changes for existing code

Builds without the option have no backward-incompatible changes. In a combined build, php --fpm gains meaning, and a CLI executable named php-fpm* starts FPM. PHP_SAPI still reports cli or fpm-fcgi for the selected mode. PHP_BINARY in FPM mode points to the combined executable.

Where it stands

Matthieu Napoli announced the RFC on internals on October 6, 2026. It targets PHP 8.7, and the implementation is under review in pull request #23558. Voting hasn't opened yet. The primary vote will need a two-thirds majority. A secondary vote decides whether the option is enabled by default when both SAPIs are built.