Skip to content

Add PHP 8.6 images (8.6, 8.6-frankenphp, 8.6-www) - #24

Draft
deluxetom wants to merge 6 commits into
masterfrom
feat/php-8.6-images
Draft

deluxetom wants to merge 6 commits into
masterfrom
feat/php-8.6-images

Conversation

@deluxetom

@deluxetom deluxetom commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Adds PHP 8.6 versions of the three 8.5 images. They're copied from 8.5, 8.5-frankenphp and 8.5-www and use PHP 8.6.0RC7, since 8.6.0 isn't out yet.

What changed

  • 8.6 (PHP-FPM + Caddy): same build as 8.5, on php:8.6.0RC7-fpm-trixie.

  • 8.6-frankenphp and 8.6-www:

    • FrankenPHP doesn't publish any php8.6 images yet. It has neither runtime nor -builder tags.
    • Starting with 8.6, docker-library builds every php image as ZTS with the embed SAPI, and the separate -zts variant is gone (remove zts, instead all images are always built as zts (8.6+) docker-library/php#1686). php:8.6.0RC7-cli-trixie is therefore the base.
    • A builder stage compiles FrankenPHP 1.13.5 (which already has 8.6 code paths) and e-dant/watcher 0.14.5, following the upstream FrankenPHP Dockerfile.
    • 8.6-frankenphp is built the same way as the upstream binary, so it includes Mercure, Vulcain and brotli. 8.6-www uses xcaddy with the same extra modules as 8.5-www (jwt, ratelimit, redis storage).
    • The final stage recreates the runtime parts of the upstream image: XDG dirs, GODEBUG, exposed ports and the docker-php-entrypoint tweak. It has no CMD, matching the published 8.5 images.
  • Extensions. PHP 8.6 removed internal C APIs: XtOffsetOf(), zval_dtor(), INI_STR/INT/FLT, zval_is_true(), and the param argument of php_verror(). I built each extension on its own against php:8.6.0RC4-cli-trixie:

    Extension PHP 8.6 status What the 8.6 images do
    apcu 5.1.28 fails; 5.1.29 was released then reverted, not on PECL krakjoe/apcu@66300e2 (the 5.1.29 release commit)
    igbinary 3.2.17RC1 fails igbinary/igbinary@2b1f5d6 (master)
    imagick 3.8.1 fails Imagick/imagick@55ed2e9 (master)
    redis 6.3.0 fails; the GitHub tarball lacks the liblzf submodule, so install-php-extensions can't install it built by the new scripts/install-phpredis.sh from phpredis/phpredis@623e8db (develop, PHPREDIS_REF), with the same options as install-php-extensions (igbinary, lzf, zstd, lz4), stripped
    amqp 2.2.0 and latest fail, also with Replace XtOffsetOf() with offsetof() for PHP 8.6 php-amqp/php-amqp#619 applied sctr/php-amqp@7a4318b: the php-8.6-support branch of our fork, proposed upstream. It passes the php-amqp test suite on 8.6.0RC4 (184 passed, 0 failed)
    protobuf 5.37.0RC3 still uses zval_dtor not included (10-grpc.ini removed too)
    grpc 1.85.0 and master still use XtOffsetOf not included
    everything else builds from PECL / bundled (deepclone pinned at v0.8.10) unchanged
  • Image size. Two changes that are specific to the 8.6 images:

    • webp: Debian's webp package depends on OpenGL only for its vwebp viewer, and that pulls in 35 packages: Mesa, LLVM and libz3, about 196 MB. The images now unpack its command-line tools (cwebp, dwebp, gif2webp, img2webp, webpinfo, webpmux) from the .deb and install only their runtime libraries. vwebp is not included.
    • FrankenPHP binary: cap_net_bind_service is set in the builder stage, and COPY keeps it. Running setcap in the final stage had rewritten the 58 MB binary into a second layer.

    Measured locally on RC5 (uncompressed): 8.6 went from 1,583 to 1,305 MB (−278 MB), 8.6-frankenphp from 1,744 to 1,389 MB (−355 MB), and 8.6-www is now 1,316 MB.

  • ini files, entrypoints, supervisor and Caddy configs are unchanged from 8.5. The defensive CVE-2026-109619 ini settings are kept even though the 8.6 RCs already contain the fix.

  • CI: all three 8.6 variants are added to the amd64, arm64 and manifest matrices.

  • scripts/test-image.sh:

    • It picks the variant from the suffix (-www, -frankenphp, or none) instead of hard-coding 8.5.
    • It now checks redis explicitly, because on 8.6 redis isn't in EXTENSIONS.
    • It maps vendor/php-name@ref sources to the extension name, so sctr/php-amqp@… is checked as amqp.
    • It checks the image optimization tools, does a cwebp/dwebp round trip, and checks the frankenphp capability. These checks also pass on the published 8.5 images.
  • README and CLAUDE.md are updated, including a "PHP 8.6 images" section.

Testing

Built locally on amd64 and checked with scripts/test-image.sh ✅. That covers extensions, OPcache, Imagick, Composer, libvips, the image tools, Caddy modules, the FrankenPHP capability and the entrypoint checks.

  • On 8.6.0RC5: all three images pass.
  • On 8.6.0RC7 with deepclone v0.8.10: 8.6-www passes; 8.6-frankenphp and 8.6 are covered by CI on both architectures.

Earlier checks:

  • Both FrankenPHP images serve a PHP request (HTTP 200) with the shipped Caddyfile.
  • amqp from the fork does a publish/get/consume/ack round trip against RabbitMQ 4.
  • redis, built with scripts/install-phpredis.sh after igbinary, round-trips igbinary-serialized values through Redis 8.10 with zstd, lz4 and lzf compression.

Follow-up

  • Bump PHP_VERSION in the three 8.6 Dockerfiles as new RCs come out and at 8.6.0 GA. A daily scheduled check does this and watches for extension releases.
  • When the PECL releases support 8.6, switch apcu/igbinary/imagick/redis/amqp back to PECL and restore protobuf, grpc and 10-grpc.ini.
  • Once FrankenPHP publishes php8.6 images, the FrankenPHP variants can go back to the dunglas/frankenphp base.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NHpZkQveWSKv5oAqcZ6DJC

Copied from the three 8.5 variants and built on PHP 8.6.0RC4.

- 8.6: same PHP-FPM + Caddy build on php:8.6.0RC4-fpm-trixie.
- 8.6-frankenphp / 8.6-www: FrankenPHP publishes no PHP 8.6 images, so
  FrankenPHP 1.13.4 (which already supports 8.6) and e-dant/watcher are
  compiled in a builder stage following the upstream Dockerfile. Since
  8.6 every official php image is ZTS with the embed SAPI (the -zts tag
  was dropped), so php:8.6.0RC4-cli-trixie is the base.
- Add the variants to the CI matrices and generalize test-image.sh
  variant detection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NHpZkQveWSKv5oAqcZ6DJC

Copy link
Copy Markdown
Contributor Author

All six 8.6* jobs fail during install-php-extensions, at the first PECL extension (apcu). The 8.5* jobs aren't affected.

This PR caused it, and there's no fix that can be ported in. PHP 8.6 removed several internal C APIs (UPGRADING.INTERNALS): XtOffsetOf(), zval_dtor(), INI_STR/INI_INT/INI_FLT, zval_is_true(), and the param argument of php_verror(). Several PECL extensions in the 8.5 extension lists haven't been released with support for this yet. I built each extension on its own against php:8.6.0RC4-cli-trixie:

Status Extensions
✅ Builds from PECL ast, maxminddb, mongodb, uuid, opentelemetry, zstd, deepclone, all bundled extensions
🔧 Builds only from unreleased upstream code apcu (krakjoe/apcu 5.1.29 release commit 66300e2, release reverted, not on PECL), igbinary (master), imagick (master), redis (phpredis develop; the GitHub tarball lacks the liblzf submodule, so it needs a custom build step)
❌ No upstream code builds on 8.6 amqp (latest, and also with php-amqp/php-amqp#619 applied: still uses INI_*), protobuf (main still uses zval_dtor), grpc (1.85.0 and master still use XtOffsetOf)

The fix depends on a choice about extension coverage, which I've put to the PR author. I'm not re-running the jobs, because they would fail the same way.


Generated by Claude Code

…rces

PHP 8.6 removed internal C APIs (XtOffsetOf, zval_dtor, INI_STR/INT/FLT,
zval_is_true, the php_verror param argument), so the current PECL
releases of apcu, igbinary, imagick, redis, amqp, protobuf and grpc
fail to compile.

- apcu (5.1.29 release commit), igbinary and imagick: pinned upstream
  commits via install-php-extensions.
- redis: new scripts/install-phpredis.sh builds a pinned phpredis commit
  with its liblzf submodule, using the same options as
  install-php-extensions.
- amqp, protobuf, grpc: removed from the 8.6 images (and 10-grpc.ini),
  since no upstream code compiles on 8.6 yet.
- test-image.sh checks redis separately, since it is no longer in
  EXTENSIONS on 8.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NHpZkQveWSKv5oAqcZ6DJC
php-amqp has no PHP 8.6 support upstream yet. The sctr/php-amqp
php-8.6-support branch replaces XtOffsetOf() and the INI_STR/INT/FLT
macros removed in 8.6 (proposed upstream to php-amqp/php-amqp) and
passes the php-amqp test suite on 8.6.0RC4.

Pin that commit in the three 8.6 images, and let test-image.sh map
"vendor/php-name@ref" GitHub sources to their extension name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NHpZkQveWSKv5oAqcZ6DJC
Picks up the fixes since 671e726: a use-after-free in cluster_mkey_cmd,
ZSCAN against Redis 8.12, getLastError()/clearLastError() throwing after
a failed connect, and additional zval type checks (plus the new
BITRANGEINARRAY command). Build files (config.m4, package.xml,
.gitmodules) are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NHpZkQveWSKv5oAqcZ6DJC
- webp: Debian's webp package depends on OpenGL only for its vwebp
  viewer, which pulls in ~196 MB of Mesa, LLVM and libz3 (35 packages).
  Unpack its command-line tools (cwebp, dwebp, gif2webp, img2webp,
  webpinfo, webpmux) from the .deb and install only their runtime
  libraries.
- FrankenPHP variants: set cap_net_bind_service in the builder stage.
  COPY keeps it, and running setcap in the final stage rewrote the
  58 MB binary into a second layer.
- install-phpredis.sh: strip redis.so (3.2 MB unstripped), like the
  extensions install-php-extensions builds.
- test-image.sh: check the image optimization tools, a cwebp/dwebp round
  trip and the frankenphp capability (both also pass on the published
  8.5 images).

Also bump PHP to 8.6.0RC5, FrankenPHP to 1.13.5 and phpredis to the
latest develop commit (623e8db).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NHpZkQveWSKv5oAqcZ6DJC
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