Skip to content

One binary for php and php-fpm - #352

Draft
mnapoli wants to merge 6 commits into
4.xfrom
v4-cli-fpm
Draft

mnapoli wants to merge 6 commits into
4.xfrom
v4-cli-fpm

Conversation

@mnapoli

@mnapoli mnapoli commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

php and php-fpm become one binary (php-fpm is a symlink to php, which runs FPM when invoked as php-fpm): FPM maps the binary that Bref's bootstrap (the CLI) already loaded. Measured in research: -12 to -16 ms of FPM cold start and 8 MB less memory.

This is php/php-src#23558, not merged yet. src/cli-fpm/php-XX.patch holds a patch per PHP version, applied with --enable-cli-fpm when it exists: 8.5 (the backport from the October benchmarks) and 8.6 (php/php-src#23558's diff, plus the rename of FPM's apache_request_headers() implementation to fpm_request_headers(), which master has (php/php-src#24249) and PHP-8.6 does not; without it the CLI server and FPM define the same C symbol). The 8.6 patch is used once PHP 8.6 is supported (#358). 8.3 and 8.4 keep two binaries. The test checks that php-fpm is the php binary from 8.5 on.

make test passes for 8.4 and 8.5 (arm64).

@mnapoli mnapoli mentioned this pull request Nov 18, 2026
@mnapoli mnapoli self-assigned this Nov 18, 2026
@mnapoli
mnapoli added this pull request to stack #354 November 18, 2026 20:42
Base automatically changed from v4-images to 4.x November 23, 2026 11:04
Backport of php/php-src#23558, applied when src/cli-fpm has a patch for the PHP version:
php-fpm is a symlink to php, so FPM maps the binary the CLI bootstrap already loaded
(-12 to -16 ms of FPM cold start, 8 MB less memory).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant