PHP 8.2 stops getting security fixes on 31 December 2026, and that same day the php:8.2 and wordpress:php8.2 images on Docker Hub will stop being rebuilt. The same day, active support for PHP 8.4 ends; it keeps security fixes until the end of 2028. I tested the move on 12 November 2026 on Linux arm64 with Docker 29.5.2: a WordPress 7.1.4 site with five popular plugins and the most common Dockerfile lines, on 8.2, 8.4 and 8.5. WordPress made the jump without errors; what broke was rolling back and building the images. There is also a Spanish version of this guide.

Key takeaways

  • wordpress:latest runs PHP 8.3.36, not 8.4. To move to 8.4 you have to pin the php8.4-apache or php8.4-fpm tag.
  • With WooCommerce, Elementor, Yoast SEO, WPForms and Contact Form 7, the 10 pages I tested answered the same on 8.2, 8.4 and 8.5. On 8.4 the debug.log stayed empty.
  • Contact Form 7 6.2 requires PHP 8.3: on 8.2, WordPress refuses to update it and you stay on 6.1.7.
  • If you go back to php8.2 by changing only the tag after updating your plugins, the whole site returns 500.
  • In a custom Dockerfile, docker-php-ext-install imap fails from 8.4 on, and docker-php-ext-install opcache breaks the build on 8.5.

What happens to PHP 8.2 and 8.4 on 31 December?

On 31 December PHP 8.2 reaches end of life and PHP 8.4 moves to security fixes only. The dates come from the endoflife.date API for PHP[1], which tracks the official schedule:

Version Active support until Security fixes until Latest release (21 Oct 2026)
PHP 8.2 31 Dec 2024 31 Dec 2026 8.2.35
PHP 8.3 31 Dec 2025 31 Dec 2027 8.3.36
PHP 8.4 31 Dec 2026 31 Dec 2028 8.4.27
PHP 8.5 31 Dec 2027 31 Dec 2029 8.5.12

In Docker, end of life has a visible effect: the image stops being rebuilt. That is what happened with PHP 8.1. On Docker Hub, php:8.1-fpm and php:8.1-apache were last updated on 31 December 2025, and wordpress:php8.1 on 1 January 2026. That last one still ships WordPress 6.9, while the active tags already ship 7.1.4.

A frozen image gets no more fixes for PHP, Apache or Debian. If you are still on 8.2 in January, you also miss fixes like the ones for the October PHP vulnerabilities, which reached 8.2.35.

Which PHP version to move to: 8.3, 8.4 or 8.5?

Move to 8.4: it has security fixes until 2028, and in my test it added not a single entry to the log. WordPress 7.1 runs on any of the four, according to the WordPress PHP compatibility table[2], which marks 7.4 through 8.5 as compatible.

Tag PHP Security until What I saw in the test
wordpress:latest 8.3.36 31 Dec 2027 The default tag; you will have to move again in a year
wordpress:php8.4-apache 8.4.27 31 Dec 2028 No debug.log entries with the five plugins
wordpress:php8.5-apache 8.5.12 31 Dec 2029 12 Deprecated notices from Yoast SEO per round of visits

PHP 8.5 works too, and it is what this blog runs in production. Its deprecation notices still come from widely installed plugins: Yoast SEO 28.8 logged Using null as an array offset is deprecated on six lines of its memoizers. Nothing breaks, but the log fills up until the authors fix it.

Plugins are already leaving PHP 8.2 behind

Contact Form 7, with more than 10 million active installs, requires PHP 8.3 from version 6.2. Up to 6.1.x it asked for 7.4, according to the readme of the 6.2 tag[3], released on 6 October. On PHP 8.2, WordPress will not let you update it:

$ wp plugin update contact-form-7
Warning: contact-form-7: This update requires PHP version 8.3,
but the version installed is 8.2.35.
Error: No plugins updated.

The plugin keeps working on 6.1.7, but it no longer gets new fixes. You can see which plugins are in that state with wp plugin list --fields=name,version,update,update_version: the blocked ones show unavailable in the update column.

Of the 50 most popular plugins in the directory on 12 November, 25 require PHP 7.4 or later. Three already require 8.1 (the two Hostinger plugins and Better Search Replace) and one, Contact Form 7, requires 8.3. The list will grow once 8.2 is out of support.

What changes in WordPress when you move from the php8.2 to the php8.4 image

When I changed the tag, WordPress kept working the same. I set up WordPress 7.1.4 with MariaDB 11.8.9, WooCommerce 11.3.0, Elementor 4.4.0, Yoast SEO 28.8, WPForms 2.0.4 and Contact Form 7, with WP_DEBUG_LOG on. Then I swapped the image over the same volume and visited the same 10 URLs: home, a post, the shop, the REST API, the login page and five admin screens.

All of them returned the same status code on the three versions. The debug.log had 0 lines on 8.2, 0 on 8.4 and 12 Deprecated notices on 8.5, all from Yoast SEO. On 8.4, the Contact Form 7 update from 6.1.7 to 6.2.5 installed without trouble.

The change in compose.yaml is one line. The image only copies WordPress into the volume when it is empty, so your install, plugins and uploads are left alone:

services:
  wordpress:
    image: wordpress:php8.4-apache   # was: wordpress:php8.2-apache
    volumes:
      - html:/var/www/html

If you run the FPM variant behind Nginx or Caddy, switch to wordpress:php8.4-fpm or wordpress:php8.4-fpm-alpine. If your proxy is Caddy 2.11, also check the File not found error with php_fastcgi, which comes from upgrading Caddy, not from changing PHP.

500 error when going back to PHP 8.2: Composer detected issues in your platform

Going back to wordpress:php8.2 by changing only the tag takes the site down if you already updated a plugin on 8.4. I reproduced it like this: on 8.4 I updated Contact Form 7 to 6.2.5, then went back to the 8.2 image. Every page answered HTTP/1.1 500 Internal Server Error with this error:

PHP Fatal error:  Uncaught RuntimeException: Composer detected
issues in your platform: Your Composer dependencies require a PHP
version ">= 8.3.0". You are running 8.2.35. in /var/www/html/
wp-content/plugins/contact-form-7/vendor/composer/platform_check.php

The plugin ships Composer's platform check and stops before WordPress can deactivate it. That is why a rollback has to restore the files and the database, not just the tag. With the backup from the next step, the site answered 200 again on 8.2 with Contact Form 7 back on 6.1.7.

How to make the switch and keep a way back

Back up the database and the volume before you change the image; it was the only rollback that worked. These commands assume a Compose project with the db and wordpress services and the wpphp_html volume. Replace the names with yours:

mkdir -p backup
docker compose exec -T db sh -c 'mariadb-dump -uroot \
  -p"$MARIADB_ROOT_PASSWORD" --single-transaction wordpress' \
  > backup/wordpress.sql
docker run --rm -v wpphp_html:/data -v "$PWD/backup":/backup alpine \
  tar czf /backup/html.tar.gz -C /data .

In my test the dump took 302 KB and the volume copy 83 MB, with WooCommerce and Elementor inside. If you already run encrypted backups with restic, take one right before. Then change the tag, recreate the service and read the log:

docker compose up -d wordpress
docker compose exec wordpress php -v
docker compose exec wordpress tail -n 50 /var/www/html/wp-content/debug.log

The debug.log only exists if you turn on WP_DEBUG and WP_DEBUG_LOG. With the official image, add WORDPRESS_DEBUG: "1" and define('WP_DEBUG_LOG', true); to WORDPRESS_CONFIG_EXTRA while you test, and remove them afterwards. If something fails, stop the service, empty the volume, extract html.tar.gz, import wordpress.sql and start with the previous tag.

If you update your containers with Watchtower, it will not move you from 8.2 to 8.4 by itself: it follows the tag you pin. From January on, it will find nothing new to pull for php8.2.

What breaks in your Dockerfile with php:8.4 and php:8.5

If you build your own image from php, the failures show up at build time, not in the browser. I tried the most common docker-php-ext-install lines on php:8.2-fpm, php:8.4-fpm and php:8.5-fpm, all three on Debian 13 (trixie):

Dockerfile line 8.2 8.4 8.5
docker-php-ext-install opcache Works Works Fails, exit code 2
docker-php-ext-install imap Fails on trixie Cannot find config.m4. Cannot find config.m4.
docker-php-ext-install pspell Works ext/pspell does not exist ext/pspell does not exist

The PHP 8.4 migration notes[4] explain IMAP and Pspell: "These extensions have been moved to PECL and are no longer part of the PHP distribution". The same goes for OCI8 and PDO_OCI.

IMAP on PHP 8.4: Cannot find config.m4

From 8.4 on, IMAP installs through PECL, and on Debian 13 not even that way, because Debian 13 lacks the libc-client library. On php:8.4-fpm, apt-get install libc-client-dev answers E: Unable to locate package libc-client-dev. Two bases work: php:8.4-fpm-bookworm (Debian 12) or the Alpine variant.

FROM php:8.4-fpm-bookworm
RUN apt-get update \
 && apt-get install -y --no-install-recommends libc-client-dev libkrb5-dev \
 && printf "\n" | pecl install imap \
 && docker-php-ext-enable imap \
 && rm -rf /var/lib/apt/lists/*

On that base, pecl install imap installed imap-1.0.3 in 2 seconds and imap_open() became available. On php:8.4-fpm-alpine it worked the same after apk add imap-dev krb5-dev openssl-dev $PHPIZE_DEPS. The wordpress image has never shipped IMAP, so this change only affects you with a custom Dockerfile.

OPcache on PHP 8.5: cp: cannot stat 'modules/*'

On PHP 8.5, OPcache is part of the binary, and asking to install it breaks the build. The PHP 8.5 backward-incompatible changes[5] put it this way: "The Opcache extension is now always built into the PHP binary and is always loaded". The image's script does not account for it:

cp: cannot stat 'modules/*': No such file or directory
make: *** [Makefile:89: install-modules] Error 1
ERROR: failed to build: failed to solve: process "/bin/sh -c
docker-php-ext-install pdo_mysql opcache" did not complete
successfully: exit code: 2

docker-library/php issue #1631[6], open since 21 November 2025, is still unresolved. The fix is to install OPcache only when the version is older than 8.5. This Dockerfile built on 8.2, 8.4 and 8.5 with pdo_mysql, intl and OPcache loaded:

ARG PHP_VERSION=8.4
FROM php:${PHP_VERSION}-apache
RUN apt-get update && apt-get install -y --no-install-recommends libicu-dev \
 && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install pdo_mysql intl \
    $(php -r 'echo PHP_VERSION_ID < 80500 ? "opcache" : "";')
RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY . /var/www/html/

If you carry an old .ini with zend_extension=opcache.so, remove it as well. On 8.5 every start prints Warning: Failed loading Zend extension 'opcache.so'.

Deprecated notices on the page and redirects that stop working

The php:*-apache image ships no php.ini, so display_errors is 1 and every new 8.4 notice is written into the page. I checked it with an index.php that declares a typed parameter with = null and no ?, then redirects with header('Location: …'). On 8.2 it answered 302 Found. On 8.4 it answered 200 OK with this text on the page:

Deprecated: load(): Implicitly marking parameter $o as nullable is
deprecated, the explicit nullable type must be used instead
Warning: Cannot modify header information - headers already sent

The notice is printed before the header and the redirect is lost. The cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" line in the Dockerfile above fixes it: with it the 302 came back and error_reporting was 22527, which leaves out deprecation notices. The wordpress image does not have this problem, because it ships its own error-logging.ini with display_errors = Off.

To find these notices before you switch, I ran a script with typical 8.2-era code on the three versions. It printed no notice on 8.2, 3 on 8.4 and 7 on 8.5, and none of them stopped execution:

  • Typed parameters with = null and no ? (8.4)
  • The E_STRICT constant (8.4)
  • trigger_error() with E_USER_ERROR (8.4)
  • The (integer), (boolean) and (double) casts (8.5)
  • The backtick operator as a shortcut for shell_exec() (8.5)
  • curl_close(), which does nothing since PHP 8.0 (8.5)
  • null as an array offset (8.5)

Is WordPress faster on PHP 8.4 than on 8.2?

Not in my test: the gap between versions was smaller than the variation between rounds of the same version. I measured time to first byte for the home page, the shop and the REST API with WP_DEBUG off and OPcache on, in three rounds of 30 requests after 10 warm-up requests:

WordPress 7.1.4 time to first byte by PHP version ms · lower is better
Home page
PHP 8.2: 53.4 ms
PHP 8.4: 55.9 ms
PHP 8.5: 59.5 ms
WooCommerce shop
PHP 8.2: 54.1 ms
PHP 8.4: 55.4 ms
PHP 8.5: 58.3 ms
REST API, /wp-json/wp/v2/posts
PHP 8.2: 27.0 ms
PHP 8.4: 31.4 ms
PHP 8.5: 28.0 ms
Show the data table
PagePHP 8.2PHP 8.4PHP 8.5
Home page53.4 ms55.9 ms59.5 ms
WooCommerce shop54.1 ms55.4 ms58.3 ms
REST API, /wp-json/wp/v2/posts27.0 ms31.4 ms28.0 ms

Median of the medians of 3 rounds of 30 requests, WP_DEBUG off, wordpress:php8.x-apache images with WooCommerce, Elementor, Yoast SEO, WPForms and Contact Form 7 6.1.7, Docker 29.5.2 on shared Linux arm64, 12 November 2026. On 8.2 the home page ranged from 51.8 to 68.9 ms between rounds.

The machine was shared, and the 8.2 home page moved 17 ms between rounds, more than any gap between versions. Do not upgrade expecting a speed-up, and do not fear a slowdown: the reason to switch is security fixes.

Frequently asked questions

Can I stay on wordpress:php8.2 after 31 December?

You can, but the image will stop being rebuilt, as wordpress:php8.1 did on 1 January 2026. WordPress will keep updating itself inside the volume, but PHP, Apache and Debian will stay as they are on that day. And more and more plugins will stop updating: Contact Form 7 already has.

Do I have to reinstall WordPress to change PHP versions?

No. The image only copies the WordPress files into the volume when it is empty. Moving from php8.2 to php8.4 over the same volume kept the 7.1.4 core, the plugins and the database. Only the PHP interpreter that runs those files changes.

Does this affect me if I use PHP-FPM with Nginx instead of Apache?

Yes, in the same way. The php8.4-fpm and php8.4-fpm-alpine tags ship the same PHP version and the same error-logging.ini as the Apache variant. What does not change is your Nginx configuration: the service still listens on port 9000.

Conclusion

Before the end of the year, move your PHP 8.2 containers to php8.4, which has security fixes until 2028. In WordPress it is a one-line change, and it gave no errors in my test. Back up the database and the volume first, because rolling back with only the tag returns a 500 error.

In your own Dockerfiles, check IMAP, Pspell and the OPcache line before you build on 8.4 or 8.5. Also copy php.ini-production if your image is php:*-apache.

Sources: [1] endoflife.date, PHP release schedule[1], [2] PHP, extensions removed in 8.4[4], [3] PHP, backward-incompatible changes in 8.5[5], [4] PHP, deprecated features in 8.5[7], [5] docker-library/php, issue #1631: Do not fail when building PHP 8.5 with opcache[6], [6] WordPress, PHP compatibility and WordPress versions[2], [7] Contact Form 7, readme of version 6.2[3], [8] wordpress image tags on Docker Hub[8].

Sources

  1. endoflife.date API for PHP
  2. WordPress PHP compatibility table
  3. readme of the 6.2 tag
  4. PHP 8.4 migration notes
  5. PHP 8.5 backward-incompatible changes
  6. docker-library/php issue #1631
  7. PHP, deprecated features in 8.5
  8. wordpress image tags on Docker Hub