Skip to content

Fix PECL migration: verify PHP extensions actually load, repair if broken#2826

Merged
enoch85 merged 1 commit into
mainfrom
fix-2820-php-extension-repair
Jul 7, 2026
Merged

Fix PECL migration: verify PHP extensions actually load, repair if broken#2826
enoch85 merged 1 commit into
mainfrom
fix-2820-php-extension-repair

Conversation

@enoch85

@enoch85 enoch85 commented Jul 7, 2026

Copy link
Copy Markdown
Member

The PECL→OS package migration could leave systems without working redis/igbinary/smbclient extensions (Memcache OC\Memcache\Redis not available for local cache), and re-running the update never repaired them because the migration only triggered on PECL registry state.

The block is now state-based: after removing PECL leftovers, each extension is health-checked with php -m (not loaded, or loaded twice via stale enable symlinks = broken). If anything is broken, all three packages are purged and reinstalled as one unit (php-redis depends on php-igbinary), stale enable symlinks are removed, conffiles are force-restored, and the result is verified again.

  • Auto-heals already broken installations on their next update run (the block runs before occ upgrade)
  • No-op on healthy systems
  • Tested in a local VM (release-34.0.1 image): reproduced the exact breakage from the issue by recreating the pre-migration PECL state and running the old migration code, then verified this block repairs it — fresh migration, gutted-package state, double-loaded state, and idempotency all pass

Fixes #2820

…if not

The PECL to OS package migration left systems broken when the OS package
was already installed: pecl uninstall deleted the dpkg-owned .so, the
mods-available .ini (a dpkg conffile) was removed and never restored, and
phpdismod -v ALL left the modules disabled. Re-running the update never
repaired this since the migration only triggered on PECL registry state.

The block is now state-based instead of history-based: after cleaning up
PECL leftovers, each extension is checked with php -m (not loaded, or
loaded twice via stale enable symlinks = broken). If any of them is
broken, all three packages are purged and reinstalled as one unit (they
are interdependent), stale enable symlinks are removed, and the result
is verified again.

This auto-heals already broken installations on their next update run
and is a no-op on healthy systems.

Fixes #2820
@enoch85 enoch85 force-pushed the fix-2820-php-extension-repair branch from 53a72b3 to 064d752 Compare July 7, 2026 18:04
@enoch85 enoch85 merged commit d1cb1d8 into main Jul 7, 2026
7 of 9 checks passed
@enoch85 enoch85 deleted the fix-2820-php-extension-repair branch July 7, 2026 18:06
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.

Failed update due to PHP upgrade

1 participant