Re: [RFC] Single binary for CLI and FPM

From: Date: Tue, 06 Oct 2026 12:06:48 +0000
Subject: Re: [RFC] Single binary for CLI and FPM
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-132807@lists.php.net to get a copy of this message
Hi On 2026-10-06 12:32, Matthieu Napoli wrote:
I'd like to start the discussion on a new RFC: https://wiki.php.net/rfc/single-binary-cli-fpm
Thank you for the RFC. The proposal makes sense to me and from what I understand there are basically no drawbacks to combining the two binaries into one. I only have one concern regarding:
PHP_BINARY in FPM mode is the path of the combined php executable, where it is the path of php-fpm today (a symlink is resolved to its target). Unlike php-fpm, that executable can also run CLI scripts.
This means scripts running in a FPM web context and relying on PHP_BINARY cannot spawn fresh FPM instances (for whatever reason), without adding a --fpm flag themselves. However I don't think it is possible to determine from PHP itself if the binary is a combined binary or not. Should we have some PHP_FPM_IN_CLI constant or similar that allows scripts to make that distinction. The RFC also notes that the standalone PHP FPM binary will remain an option. Is there any reason to keep support for that, except for backward compatibility? I think we should strongly encourage folks to ship PHP as a “single binary” CLI+FPM distribution. Or just CLI where FPM is not required and the extra dependencies should go away. But just FPM doesn't feel like a reasonable use case. Best regards Tim Düsterhus

« previous php.internals (#132807) next »