Skip to content

Restore NTS as the default for 8.6, keep ZTS as the -zts variant - #1721

Open
roxblnfk wants to merge 1 commit into
docker-library:masterfrom
roxblnfk:restore-nts-default-8.6
Open

roxblnfk wants to merge 1 commit into
docker-library:masterfrom
roxblnfk:restore-nts-default-8.6

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Nov 20, 2026 •

Copy link
Copy Markdown

Refs #1719, #1686, #1673, #1689

Note

For those coming from #1719: please keep comments here to reviewing the change itself. If you've hit problems caused by the 8.6 images switching to ZTS, or have a point that hasn't been raised yet, please share it in #1719.

This restores the pre-#1686 layout for 8.6: NTS in cli/fpm/apache, and ZTS as the -zts variant, same as 8.2–8.5.

Changes

  • --enable-zts and --disable-zend-signals are again limited to the zts variant.
  • NTS variants of 8.6 get --enable-pic back, as they had before don't explicitly --enable-pic for ZTS #1692. The zts variant keeps the don't explicitly --enable-pic for ZTS #1692 behavior (no forced PIC, so local-exec TLS still works).
  • The 8.6/*/zts variants are back in versions.sh / versions.json.
  • --enable-embed for cli on Alpine 8.6+ is intentionally kept. It's already published, and libphp is useful for embedding NTS PHP too, not only for threaded SAPIs.
  • 8.2–8.5 are unchanged (regenerated with ./apply-templates.sh, no diff).

Why

Consequences

Downstream images that already switched to php:8.6-cli as their ZTS base (e.g. FrankenPHP's docker-bake.hcl) would need to use -zts again for 8.6.

Testing

Tested locally (8.6/trixie/cli and 8.6/trixie/zts):

$ docker run --rm <8.6/trixie/cli> php -r 'echo PHP_VERSION, " ZTS=", var_export(PHP_ZTS, true), "\n"; set_time_limit(2); sleep(4); echo "ok\n";'
8.6.0 ZTS=false
ok

$ docker run --rm <8.6/trixie/zts> php -r '...same...'
8.6.0 ZTS=true
Fatal error: Maximum execution time of 2 seconds exceeded in Command line code on line 1

/usr/local/lib/libphp.so is present in both images.

Future scope

Not part of this PR: to make a future move to ZTS smoother, if upstream ever decides on it, the images could add -nts aliases for the NTS variants starting with 8.6 (8.6-cli-nts, 8.6-fpm-nts, 8.6-apache-nts, …). They would point to the same images, so no extra builds. Users could then state their thread-safety requirement explicitly (-nts or -zts), and a later change of the default wouldn't silently change behavior for them. I'm happy to send a separate PR if that sounds reasonable.

There is no upstream decision to drop NTS, so 8.6 goes back to the 8.2-8.5 layout. NTS variants get --enable-pic back (as before docker-library#1692), while the zts variant keeps the docker-library#1692 behavior. --enable-embed for cli on Alpine 8.6+ is kept since it is already published.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@TimWolla

TimWolla commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

it changes runtime behavior

So does upgrading from PHP 8.5 to PHP 8.6. The introduction of new symbols to the standard library is technically also a breaking change.

through the floating tags (latest, 8, cli, fpm, apache, …)

I consider making available the php:8 tag a mistake, unfortunately one that is not easy to remediate before PHP 9.0 arrives where a php:9 tag could be omitted. Upgrading to a new PHP version must be a deliberate change.


There was a 2-month pre-release period where this change was active and feedback could be provided (including a pinned issue). It's in a stable release now. This PR is extremely disruptive to folks that did everything right by testing the pre-releases, preparing for the change and who rightfully expect to be able to rely on behavior remaining unchanged within a given branch (i.e. when using php:8.6 as the image).

@rustatian

rustatian commented Nov 20, 2026 •

Copy link
Copy Markdown

There was a 2-month pre-release period where this change was active and feedback could be provided (including a pinned issue)

Yes, and I, for example, actively fixed all breaking changes in PHP 8.6 in the SAPI layer for our SAPI (not blaming anyone) to support PHP8.6 on the release date. And I actively analyzed almost all commits to php-src, but not to the official Dockerfiles (looks like I also need to analyze commits here) from the Docker (probably my mistake).

This PR is extremely disruptive to folks that did everything right by testing the pre-releases

This PR brings everything back as it should be, reverting the minority (respectfully) to decide for the majority.
Except package maintainers, OSS library developers, and a small fraction of active people in the community, nobody in the enterprise space will realize that change for probably a few months (and after that, keeping in mind the timers problem, we all see the result of that decision).
It is very unlikely that even small companies have switched to PHP 8.6 yet. So atm, we have a unique opportunity: instead of trying to stay on an obviously bad decision to switch the default PHP image from nts to zts, do a smart thing and revert that, learn from this mistake, re-upload fixed images, and do better for 8.7 or 9.

EDIT: and results you may already see in php-src: php/php-src#25499 for even experienced PHP guys.

@carlos-granados

This comment was marked as duplicate.

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.

4 participants