PHP · RFC Watch
PHP RFC explores embedding FPM in the php executable
Matthieu Napoli has opened an RFC for --enable-cli-fpm, a build option that embeds FPM in the php executable.
The combined binary would select FPM through --fpm as its first argument or through a php-fpm name, with normal CLI behavior preserved. Bref measurements on AWS Lambda show one executable of roughly 26 MB removed from the runtime and a 70 ms, 25% cut in minimal FPM cold starts. The standalone php-fpm executable remains available.
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.
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 symlinkNapoli 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.
Readers’ Forum
No contributions yet — open the debate.
Open the discussion
No account or password needed — just enter your e-mail and we’ll send you a one-time sign-in link. First time here? You’re set up automatically.
Your rating will be applied automatically after you sign in.
Check your inbox
We’ve sent a sign-in link to …. Open it on this device — this tab will sign you in automatically.
Nothing arrived? Check your spam folder — and mark the mail as "Not spam" so it lands in your inbox next time.