Skip to content

Migrate to PHP 8.4.27 - #158

Merged
alexandrewavelet merged 3 commits into
mainfrom
chore/php-8.4
Oct 21, 2026
Merged

alexandrewavelet merged 3 commits into
mainfrom
chore/php-8.4

Conversation

@alexandrewavelet

@alexandrewavelet alexandrewavelet commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Why

PHP 7.4 has been end-of-life since November 2022, and its Docker image is Debian 11 (bullseye), whose security mirror is gone since August 2026 — the image only builds thanks to a sed hack. PHP 8.4 is supported until 31 Dec 2028 (8.2 ends 31 Dec 2026), so we go straight to PHP 8.4.27 (php:8.4.27-apache, Debian 13 trixie).

Prod switches first, then preprod. This PR only changes the code/CI/docs side; the runtime switch is done in AlteredOps.

What changes

  • Code fixes (run unchanged on PHP 7.4 and 8.4):
    • equinox-deck-import DeckParser: pass str_getcsv()'s escape argument explicitly (8.4 deprecation; same behaviour as before).
    • pages/rss.php: guard a NULL news.slug before rawurlencode() (8.1 deprecation).
    • azure theme: __nav_href / __nav_active → acNavHref / acNavActive (the __ prefix is reserved by PHP).
    • CurlDeckApiClient: docblocks accept \CurlHandle (no code change).
  • Dockerfile: FROM php:8.4.27-apache, bullseye-security workaround removed. This image is used by the local compose, the e2e stack and the Aspire dev env.
  • CI: deploy.yml (front bundle build) and plugins-ci.yml (lint, tests, e2e) on PHP 8.4.
  • Docs: README, CONTRIBUTING, AGENTS, plugin READMEs say PHP 8.4.
  • e2e stack fix (CI only): docker-compose.stack.yml gives the decks API MERCURE_EXTRA_DIRECTIVES: "protocol_version_compatibility 8", as preprod already does (Re:Builder: keep unique illustrations, fix collection and digital ownership searches #131). Without it the decks API container (built on the latest FrankenPHP base) exits at start and the Playwright job fails before any test, whatever the PHP version — it was red on this PR for that reason only.

What does not change

  • bcrypt: PHP 8.4's default cost goes from 10 to 12 for new hashes — accepted, existing hashes still verify.
  • No Rector / syntax modernisation: the code must stay PHP 7.4-compatible while preprod still runs 7.4.

Rollout order (merging = deploying)

  1. This PR → main: deploy.yml pushes the code to prod, which still runs PHP 7.4 — the code is 7.4-compatible, nothing changes at runtime.
  2. AlteredOps PR 1 switches the prod runtime to 8.4.27.
  3. The preprod PR Migrate to PHP 8.4.27 (preprod) #159 (forward-port + 7.4/8.4 CI matrix) and AlteredOps PR 2 (Altered-Re-Union/AlteredOps#21, draft) follow once prod is validated. Runtime PR for prod: Altered-Re-Union/AlteredOps#20.

How it was verified

  • php -l on all PHP files under 8.4; touched files also under 7.4 (php:7.4-cli). PHPCompatibility (testVersion 8.4): only the 2 known false positives left.
  • Tests: tests/run.php 96/96, core-altered-cards 70/70, equinox-deck-import 21/21 on both 7.4 and 8.4 (the equinox suite emitted 6 str_getcsv deprecations on 8.4 before the fix, 0 after).
  • Image: PHP 8.4.27, Debian 13, GD with webp/jpeg/freetype/png, pdo_mysql, mbstring, zip, opcache, curl, openssl, fileinfo.
  • Local rehearsal of the exact prod bundle (AlteredOps image on 8.4.27 + mysql 8.0 + deploy sidecar, this branch delivered into web_src, sql/bootstrap.php): public pages, 7 plugins activated, admin logged in, deck image drawn by GD (fr/en), migrations over SSH in the sidecar — 0 Deprecated/Warning/Fatal.
  • Plugins CI on this PR runs the e2e suite on the 8.4.27 image.

🤖 Generated with Claude Code

alexandrewavelet and others added 2 commits October 21, 2026 21:45
str_getcsv() must receive its escape argument explicitly in PHP 8.4,
rss.php could pass a NULL slug to rawurlencode() (deprecated since 8.1),
and the azure theme used the __ prefix PHP reserves for itself. All
changes run unchanged on PHP 7.4, which preprod keeps until its own
runtime switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
php:7.4-apache is Debian 11, whose security mirror is gone, and PHP 7.4
has been end-of-life since 2022. The image, the e2e stack and the
workflows now use PHP 8.4.27 (supported until the end of 2028).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The decks API image of the e2e stack is built from a pinned commit but on
the latest FrankenPHP base, whose Mercure now refuses publisher_jwt /
subscriber_jwt outside compatibility mode: the container exits at start
and the Playwright job fails before any test, whatever the PHP version.
Same setting as preprod (#131).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alexandrewavelet
alexandrewavelet merged commit ed46e30 into main Oct 21, 2026
7 checks passed
@alexandrewavelet
alexandrewavelet deleted the chore/php-8.4 branch October 21, 2026 22:53
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