PHP's php and php-fpm executables contain the same engine and the same extensions. Only the small CLI and FPM parts differ. Systems that need both ship about 26 MB of the same code twice, and when FPM starts right after a CLI command, it loads that code a second time. Matthieu Napoli's RFC links the CLI into php-fpm, so one executable can do both jobs.

How it works

When PHP is built with both the CLI and FPM, php-fpm also contains the CLI. There's no new configure option. Called as php-fpm, it's FPM as before. Called under the name php, optionally followed by a digit, it runs as the CLI:

php-fpm --nodaemonize -y /etc/php-fpm.conf # FPM, as today

ln -s php-fpm php
./php script.php                           # CLI
php8.7 -v                                  # CLI too, through a php8.7 link

In CLI mode it behaves exactly like the php executable: PHP_SAPI is cli, it reads the same ini file, and the CLI test suite passes. The php executable itself doesn't change, and make install still installs two separate files.

Why it helps

A distribution that wants one executable installs it as php and makes php-fpm a symlink to it. On AWS Lambda with Bref, that shrank the PHP layer by 18% zipped and 28% unzipped. Cold starts for an app that runs a CLI bootstrap and then starts FPM dropped from 280 ms to 211 ms, because FPM no longer loads its own copy of the engine. The gain comes from loading PHP once, not from the smaller package: an app that never starts FPM saw no difference.

The RFC recommends that layout, with php as the real file, because PHP_BINARY resolves symlinks. Tools like Composer and PHPUnit run PHP_BINARY to start another PHP process, and they need it to be the CLI.

What changed from version 0.1

The first version went the other way: a --enable-cli-fpm option linked FPM into the php executable, which started FPM with php --fpm. After the internals discussion, the author dropped that version. It changed the php executable almost every install uses, and it added FPM's optional libraries to it. Linking the CLI into another SAPI follows what PHP 8.6 already did for the embed SAPI, which FrankenPHP uses.

What it means for existing code

Nothing changes unless PHP is built with both the CLI and FPM. In that case, php-fpm called as php or php8.7 now runs the CLI instead of FPM, and the php-fpm file grows by about 150 KB. In the single-executable layout, tools that inspect a process's executable see php for FPM processes, and PHP_BINARY in FPM mode points to /usr/bin/php.

Where it stands

Matthieu Napoli announced the RFC on internals on October 6, 2026, and published version 0.2 on October 8. It targets PHP 8.7, and the implementation is up as a php-src pull request. There's a single vote, which needs a two-thirds majority.