Matthieu Napoli has opened an RFC discussion about --enable-cli-fpm. The proposed build option adds the FPM SAPI to the php executable. FPM would start when --fpm is the first argument, or when the executable is called through a name beginning with php-fpm. Other invocations continue to use the CLI. Builds would still produce a standalone php-fpm executable.

terminal
php script.php # CLI, as today
php --fpm --nodaemonize -y /etc/php-fpm.conf # FPM
ln -s php php-fpm
./php-fpm --nodaemonize -y /etc/php-fpm.conf # FPM, through a symlink

Napoli used Bref measurements on AWS Lambda to assess the design. Shipping one executable removes one of two roughly 26 MB executables from the runtime. That frees space for application code under Lambda’s 250 MB limit. A minimal FPM application starts 70 ms faster, a 25% reduction, because FPM does not load a second copy of the engine after the CLI has loaded it. The same approach could help systems where boot speed or disk capacity matters, including autoscaling and serverless platforms.

The RFC includes a secondary vote on enabling the option by default. Marc had suggested that vote when Napoli requested RFC karma. Napoli is also seeking package maintainer feedback on shipping php-fpm as a symlink to the combined php executable, with the FPM package retaining configuration and service files. The implementation is available in php/php-src pull request 23558, which has received reviews from Jakub and Marc.