Skip to content

Remove apache variant for 8.6+ - #1688

Open
tianon wants to merge 1 commit into
docker-library:masterfrom
infosiftr:rm-apache
Open

tianon wants to merge 1 commit into
docker-library:masterfrom
infosiftr:rm-apache

Conversation

@tianon

@tianon tianon commented Sep 30, 2026

Copy link
Copy Markdown
Member

mod_php (via apache2) has been disrecommended by upstream PHP for years in favor of php-fpm (https://www.php.net/manual/en/install.unix.apache2.php). 8.6+ now builds every variant with zts enabled (2e430cd), and mod_php gains nothing from that -- it still can't use a threaded MPM, so the added thread-safety overhead is pure cost for zero benefit. Years of disrecommendation plus a new cost with no offsetting benefit is reason enough to drop the variant.

Assisted-By: "claude my eyes right out"

`mod_php` (via apache2) has been disrecommended by upstream PHP for years in favor of `php-fpm` (https://www.php.net/manual/en/install.unix.apache2.php).  8.6+ now builds every variant with zts enabled (2e430cd), and `mod_php` gains nothing from that -- it still can't use a threaded MPM, so the added thread-safety overhead is pure cost for zero benefit.  Years of disrecommendation plus a new cost with no offsetting benefit is reason enough to drop the variant.

Assisted-By: "claude my eyes right out"
@tianon

tianon commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

I'm open to making this 9.0+ instead of 8.6+, but I think going all-in on ZTS is really a compelling lever for making this change too, so IMO 8.6 is the correct place for us to finally flip this and get rid of mod_php.

https://www.php.net/manual/en/install.unix.apache2.php really doesn't mince words here:

Warning

Use PHP-FPM Instead

Do not use mod_php for new installations. The instructions on this page are retained for historical reference and for the rare cases where embedding PHP directly in the Apache httpd process is specifically required.

For all modern deployments, use PHP-FPM (FastCGI Process Manager) with Apache httpd's mod_proxy_fcgi module. PHP-FPM provides better resource management, process isolation, independent restart of PHP without restarting Apache httpd, and compatibility with Apache httpd's event MPM (the default since Apache httpd 2.4). Major Linux distributions ship this as the default configuration.

The mod_php approach embeds PHP directly into every Apache httpd worker process. Unless PHP is compiled with thread safety (--enable-zts), mod_php requires the prefork MPM, which significantly limits concurrency. If you proceed with mod_php, you should fully understand the performance and security implications.

That last paragraph seems to imply that enabling ZTS allows switching to a better MPM, but it really doesn't (primarily because other non-PHP libraries need to be thread-safe too for that to work, and they're not necessarily going to be).

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.

2 participants