Repository navigation
Replace PECL with PIE for PHP 8.1+ images - #230
Conversation
PECL is deprecated in favor of PIE (PHP Installer for Extensions), and is no longer bundled with the PHP 8.6 base images. - Install imagick, memcached, pcov, and xdebug with PIE on PHP 8.1-8.6. - Bind-mount PIE from the pinned `ghcr.io/php/pie:1.5.5-bin` image so it is not shipped in the final images. - Pass `--skip-enable-extension` to preserve the existing behavior where extensions are enabled at runtime by the entrypoint (imagick excepted). - Install Xdebug 3.6.0alpha1 on PHP 8.6 via PIE instead of building from a source tarball. - Pin imagick to 3.8.1, and add `libtool`, which PIE expects. PHP 7.4 and 8.0 continue to use PECL, as PIE requires PHP 8.1+ to run, and Xdebug 3.1.x (the last version supporting PHP 7.4) is not published for PIE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Y86gwJZGdkh78pggUy4zs
The latest tagged releases (Imagick 3.8.1, Memcached 3.4.0) do not compile against PHP 8.6, which removed the `XtOffsetOf` and `zval_dtor` compatibility macros. Both extensions build on their default branches, so they are pinned to specific commits until tagged releases with PHP 8.6 support are available. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Y86gwJZGdkh78pggUy4zs
Reverts ce55538. Images should only install released versions of extensions. Imagick and Memcached can be added to the PHP 8.6 image once tagged releases with PHP 8.6 support are published. Building Imagick from an unreleased commit also leaves its version string as `dev-master`, which fails WordPress' minimum version check in `WP_Image_Editor_Imagick::test()`, so WordPress falls back to GD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Y86gwJZGdkh78pggUy4zs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Y86gwJZGdkh78pggUy4zs
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the migration to PIE-based extension installation.
No open issues 🎉
What changed in this PR
Migrates extension installation to PIE for the WordPress development images using PHP 8.1+, while retaining PECL for PHP 7.4 and 8.0.
Changes:
- Updates the generator to bind-mount pinned PIE during builds and adds
libtoolfor PHP 8.1–8.6. - Uses pinned PIE packages for PHP 8.1–8.5, preserving default Imagick enablement and runtime toggles for other extensions.
- Adds PIE-based Xdebug installation for PHP 8.6; older images receive only a comment change.
| File | Description |
|---|---|
update.php |
Adds PIE configuration and installation generation alongside legacy PECL support. |
images/8.6/php/Dockerfile |
Installs Xdebug 3.6.0alpha1 through PIE. |
images/8.5/php/Dockerfile |
Migrates four extensions to pinned PIE packages. |
images/8.4/php/Dockerfile |
Migrates four extensions to pinned PIE packages. |
images/8.3/php/Dockerfile |
Migrates four extensions to pinned PIE packages. |
images/8.2/php/Dockerfile |
Migrates four extensions to pinned PIE packages. |
images/8.1/php/Dockerfile |
Migrates four extensions to pinned PIE packages. |
images/8.0/php/Dockerfile |
Rewords the installation comment; behavior is unchanged. |
images/7.4/php/Dockerfile |
Rewords the installation comment; behavior is unchanged. |
Review effort: Balanced
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
lancewillett
left a comment
There was a problem hiding this comment.
This looks good to me. The update.php output matches the committed Dockerfiles, and the uncommitted-changes check confirms it. In the 31ce4ec build logs, all four extensions install on 8.1–8.5 at the versions trunk's PECL build used. That includes Imagick, which already resolved to 3.8.1, so the pin changes nothing today. Imagick still loads by default, and the rest stay off until the entrypoint enables them. Memcached's configure defaults match the old PECL answers too: session and SASL on, serializers off.
Two non-blocking notes:
- On trunk, the 8.6 image has no Xdebug. So this adds Xdebug rather than replacing a tarball build, as the description and 11656fc say. Worth fixing in the squash message. In core, the PHP 8.6 job's "Run (Xdebug) tests" step will start running under 3.6.0alpha1. That job allows errors, so it can't block, but new results may show up.
- Consider pinning the PIE image by digest (
ghcr.io/php/pie:1.5.5-bin@sha256:3fca03c16df842d02b654dc382db3756058d9c128064f57cace14f8728779ce9, the digest CI resolved). That matches how this repo pins actions by SHA.
The earlier CLI 8.2 failure was a GHCR unknown blob error during push, unrelated to this change.
AI review · claude-opus-5-5
Pins `ghcr.io/php/pie:1.5.5-bin` by digest, matching how this repository pins actions by SHA. Removes Xdebug from the PHP 8.6 image. Trunk does not install Xdebug for 8.6, so adding it is a separate change for a later PR. With nothing installed through PIE, the 8.6 image also no longer needs `libtool`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Y86gwJZGdkh78pggUy4zs
|
I've gone and removed the Xdebug addition for PHP 8.6 and will follow up with this in a separate PR. |
PECL has been deprecated in favor of PIE (PHP Installer for Extensions), and
peclis no longer bundled with the PHP 8.6 base images. This switches extension installation to PIE for the PHP 8.1–8.5 images.Changes
imagick,memcached,pcov, andxdebugare now installed withpie installusing their Packagist packages:imagick/imagick:3.8.1(now pinned; it was previously unpinned)php-memcached/php-memcached:3.4.0pecl/pcov:1.0.12xdebug/xdebug:3.5.3RUNstep only (the documented approach), so it is not shipped in the final images. The image is pinned by digest (ghcr.io/php/pie:1.5.5-bin@sha256:3fca03c1…), matching how this repository pins actions by SHA. This requires BuildKit, which is the default builder fordocker buildonubuntu-latest.--skip-enable-extensionkeeps the existing behavior: extensions are installed but not enabled, andentrypoint/common.shenables them throughLOCAL_PHP_XDEBUG,LOCAL_PHP_PCOVandLOCAL_PHP_MEMCACHED. Imagick is still enabled by default (PIE runsdocker-php-ext-enablefor it).libtoolis added to the 8.1–8.5 apt packages, because PIE warns whenlibtoolizeis missing.Not changed
pecl.xdebug/xdebug:3.6.0alpha1@alpha) is left for a separate PR.INI_BOOL/INI_INT/INI_STR,XtOffsetOf,zval_dtor). Only released versions are installed, so they can be added once compatible releases are published.Testing
The 8.1–8.5 images were built locally for
linux/amd64, then checked:LOCAL_PHP_XDEBUGLOCAL_PHP_MEMCACHEDLOCAL_PHP_PCOVAfter pinning the PIE image by digest, the 8.5 and 8.6 images were rebuilt to confirm the pinned mount works. 8.5 still ships
imagick,memcached,pcov, andxdebug, with only Imagick enabled, and 8.6 installs no extra extensions.For 7.4, 8.0, and 8.6, the only change to the generated Dockerfiles is the reworded
# install the required PHP extensionscomment.Notes for reviewers
php:8.6-rc-fpmimage as thread-safe (8.6.0 ts, extension dirno-debug-zts-20260924), which is unusual for an-fpmvariant. This doesn't affect the PR, but it may be worth a look.🤖 Generated with Claude Code
https://claude.ai/code/session_011Y86gwJZGdkh78pggUy4zs