Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@

### Minor changes

* **2026-10-05**
* The build now fails when an extension cannot be installed (failures were silently ignored)
* Fix rdkafka: installed from the stable package (6.0.5) instead of an alpha version, and now available on PHP 8.5
* Fix Blackfire CLI missing since its versioning switched to calendar versions
* Fix swoole requiring mysqlnd
* Document the supported PHP and NodeJS versions
* Add the `decimal`, `gnupg`, `inotify`, `lz4`, `mcrypt`, `odbc`, `pdo_odbc` and `zstd` extensions on PHP 8.2+
* Remove the unused `weakref` extension (PHP provides `WeakReference` natively since 7.4)

* **2025-11-26**
* Support for PHP 8.5

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _test-prerequisites: blueprint

test-hot: ## Test 7.4, 8.0 and 8.1 quickly
docker buildx bake --load \
--set "*.platform=$(uname -p)" \
--set "*.platform=$$(docker version -f '{{.Server.Os}}/{{.Server.Arch}}')" \
php80-slim-cli php80-cli
docker run --rm -it docker.io/thecodingmachine/php:8.0-v5-cli php -v
test-legacy-quick: ## Test 7.4, 8.0 and 8.1 quickly
Expand Down Expand Up @@ -56,21 +56,21 @@ test-node: ## Test node builds only

_test-node: _test-prerequisites ## Test node for VERSION="" and VARIANT=""
docker buildx bake --load \
--set "*.platform=$(uname -p)" \
--set "*.platform=$$(docker version -f '{{.Server.Os}}/{{.Server.Arch}}')" \
php$${VERSION//.}-$(VARIANT)-all
PHP_VERSION="$(VERSION)" BRANCH=v5 VARIANT=$(VARIANT) NODE=$(NODE) ./tests-suite/bash_unit -f tap ./tests-suite/*.sh || (notify-send -u critical "Tests failed ($(VERSION)-$(VARIANT)-node$(NODE))" && exit 1)
notify-send -u critical "Tests passed with success ($(VERSION)-$(VARIANT)-node$(NODE))"

_test-version: _test-prerequisites ## Test php build for VERSION="" and VARIANT=""
docker buildx bake --load \
--set "*.platform=$(uname -p)" \
--set "*.platform=$$(docker version -f '{{.Server.Os}}/{{.Server.Arch}}')" \
php$${VERSION//.}-$(VARIANT)-all
PHP_VERSION="$(VERSION)" BRANCH=v5 VARIANT=$(VARIANT) ./tests-suite/bash_unit -f tap ./tests-suite/*.sh || (notify-send -u critical "Tests failed ($(VERSION)-$(VARIANT))" && exit 1)
notify-send -u critical "Tests passed with success ($(VERSION)-$(VARIANT))"

_test-version-quick: _test-prerequisites ## Test php build for VERSION="" and VARIANT="" (without node variants)
docker buildx bake --load \
--set "*.platform=$(uname -p)" \
--set "*.platform=$$(docker version -f '{{.Server.Os}}/{{.Server.Arch}}')" \
php$${VERSION//.}-slim-$(VARIANT) php$${VERSION//.}-$(VARIANT)
PHP_VERSION="$(VERSION)" BRANCH=v5 VARIANT=$(VARIANT) ./tests-suite/bash_unit -f tap ./tests-suite/*.sh || (notify-send -u critical "Tests failed ($(VERSION)-$(VARIANT))" && exit 1)
notify-send -u critical "Tests passed with success ($(VERSION)-$(VARIANT)) - without node-*"
Expand Down
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,30 @@ Also, we automatically rebuild X.Y images every week, but only the latest X.Y.Z

[Major].[minor] images are automatically updated when a new patch version of PHP is released, so the PHP 8.4 image will always contain the most up-to-date version of the PHP 8.4.x branch.

## Supported versions

We only maintain the PHP and NodeJS versions that are still supported by their respective communities
(see [PHP supported versions](https://www.php.net/supported-versions.php) and [NodeJS releases](https://nodejs.org/en/about/previous-releases)).
Bugs are fixed on maintained versions only.

| PHP version | Status |
|-------------|-----------------------------------------------|
| 8.5 | Maintained (until 2029-12-31) |
| 8.4 | Maintained (until 2028-12-31) |
| 8.3 | Maintained (until 2027-12-31) |
| 8.2 | Maintained (until 2026-12-31) |
| 8.1 | **Not maintained** (end of life: 2025-12-31) |
| 8.0 | **Not maintained** (end of life: 2023-11-26) |
| 7.4 | **Not maintained** (end of life: 2022-11-28) |

| NodeJS version | Status |
|----------------|-----------------------------------------------|
| 24 | Maintained (until 2028-04-30) |
| 22 | Maintained (until 2027-04-30) |
| 20 | **Not maintained** (end of life: 2026-04-30) |

Images of non-maintained versions are still available but no longer receive fixes: use them at your own risk and plan your upgrade.

## Usage

These images are based on the [official PHP image](https://hub.docker.com/_/php/).
Expand Down Expand Up @@ -159,13 +183,14 @@ Below is a list of extensions available in this image:

**Enabled by default (in addition to extensions enabled in Slim image):** `apcu`, `hash`, `iconv`, `igbinary`, `mysqli`, `mysqlnd`, `redis`, `soap`, `xsl`, `zlib` and all enabled in slim.

**Available (can be enabled using environment variables):** `amqp` `ast` `bcmath` `blackfire` `bz2` `dba` `ds` `enchant` `exif` `excimer` `ffi` `mailparse` `msgpack` `gd` `gettext` `gmp` `grpc` `igbinary` `imagick` `imap` `intl` `ldap` `memcached` `mongodb` `pcov` `pdo_dblib` `pdo_pgsql` `pdo_sqlite` `pgsql` `pspell` `shmop` `snmp` `sockets` `sqlite3` `swoole` `tidy` `uploadprogress` `uuid` `xdebug` `xmlrpc` `xsl` `yaml`
**Available (can be enabled using environment variables):** `amqp` `ast` `bcmath` `blackfire` `bz2` `dba` `decimal` `ds` `enchant` `exif` `excimer` `ffi` `mailparse` `msgpack` `gd` `gettext` `gmp` `gnupg` `grpc` `igbinary` `imagick` `imap` `inotify` `intl` `ldap` `lz4` `mcrypt` `memcached` `mongodb` `odbc` `pcov` `pdo_dblib` `pdo_odbc` `pdo_pgsql` `pdo_sqlite` `pgsql` `pspell` `rdkafka` `shmop` `snmp` `sockets` `sqlite3` `swoole` `tidy` `uploadprogress` `uuid` `xdebug` `xmlrpc` `xsl` `yaml` `zstd`

This list can be outdated, you can verify by executing : `docker run --rm -it thecodingmachine/php:8.4-v5-cli php -m`

**Note**:

- *ev* is not available in PHP 8.1+
- *mcrypt* is deprecated and its usage is discouraged: it is provided for legacy applications only

### Enabling/disabling extensions in the fat image

Expand Down Expand Up @@ -363,9 +388,9 @@ The *fat* images come with a Node variant. You can use Node : 20 22 24. If you n
If you use the *slim* images, you can install a NodeJS version with a simple ARG during the build:

```Dockerfile
ARG NODE_VERSION=18
ARG NODE_VERSION=24
FROM thecodingmachine/php:8.4-v5-slim-apache
# The build will automatically trigger the download of Node 18
# The build will automatically trigger the download of Node 24
# (thanks to a ONBUILD hook in the slim image)
```

Expand Down
1 change: 1 addition & 0 deletions extensions/8.2/decimal
1 change: 1 addition & 0 deletions extensions/8.2/gnupg
1 change: 1 addition & 0 deletions extensions/8.2/inotify
1 change: 1 addition & 0 deletions extensions/8.2/lz4
1 change: 1 addition & 0 deletions extensions/8.2/mcrypt
1 change: 1 addition & 0 deletions extensions/8.2/odbc
1 change: 1 addition & 0 deletions extensions/8.2/pdo_odbc
1 change: 1 addition & 0 deletions extensions/8.2/zstd
1 change: 1 addition & 0 deletions extensions/8.3/decimal
1 change: 1 addition & 0 deletions extensions/8.3/gnupg
1 change: 1 addition & 0 deletions extensions/8.3/inotify
1 change: 1 addition & 0 deletions extensions/8.3/lz4
1 change: 1 addition & 0 deletions extensions/8.3/mcrypt
1 change: 1 addition & 0 deletions extensions/8.3/odbc
1 change: 1 addition & 0 deletions extensions/8.3/pdo_odbc
1 change: 1 addition & 0 deletions extensions/8.3/zstd
1 change: 1 addition & 0 deletions extensions/8.4/decimal
1 change: 1 addition & 0 deletions extensions/8.4/gnupg
1 change: 1 addition & 0 deletions extensions/8.4/inotify
1 change: 1 addition & 0 deletions extensions/8.4/lz4
1 change: 1 addition & 0 deletions extensions/8.4/mcrypt
1 change: 1 addition & 0 deletions extensions/8.4/odbc
1 change: 1 addition & 0 deletions extensions/8.4/pdo_odbc
1 change: 1 addition & 0 deletions extensions/8.4/zstd
1 change: 1 addition & 0 deletions extensions/8.5/decimal
1 change: 1 addition & 0 deletions extensions/8.5/gnupg
1 change: 1 addition & 0 deletions extensions/8.5/inotify
1 change: 1 addition & 0 deletions extensions/8.5/lz4
1 change: 1 addition & 0 deletions extensions/8.5/mcrypt
1 change: 1 addition & 0 deletions extensions/8.5/odbc
1 change: 1 addition & 0 deletions extensions/8.5/pdo_odbc
1 change: 1 addition & 0 deletions extensions/8.5/zstd
2 changes: 1 addition & 1 deletion extensions/core/blackfire/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ elif [[ "${BLACKFIRE_VERSION}" == "2" ]]; then
echo "Installing Blackfire version 2..."
mkdir -p /tmp/blackfire
curl -A "Docker" -L https://blackfire.io/api/v1/releases/cli/linux/${TARGETARCH} | tar zxp -C /tmp/blackfire
if ! /tmp/blackfire/blackfire self:version --no-ansi | grep -qE "version 2\.[0-9]+\.[0-9]+"; then
if ! /tmp/blackfire/blackfire self:version --no-ansi | grep -qE "version (2|20[0-9]{2})\.[0-9]+\.[0-9]+"; then
echo "Blackfire installed is not version 2 : $(/tmp/blackfire/blackfire self:version --no-ansi)"
exit 1
fi
Expand Down
6 changes: 6 additions & 0 deletions extensions/core/decimal/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -e
export EXTENSION=decimal

../docker-install.sh
20 changes: 12 additions & 8 deletions extensions/core/docker-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@ if [ -n "$CONFIGURE_OPTIONS" ]; then
fi

if [ -n "$EXTENSION" ]; then
set +e
PACKAGE_NAME=${PACKAGE_NAME:-$EXTENSION}
if apt-cache search --names-only "php${PHP_VERSION}-$PACKAGE_NAME" | grep "php${PHP_VERSION}-$PACKAGE_NAME"; then
set -e
apt install -y --no-install-recommends php${PHP_VERSION}-$PACKAGE_NAME
if [ -f "/etc/php/${PHP_VERSION}/mods-available/${EXTENSION}.ini" ]; then
# Some extensions are bundled in php-common on recent versions (e.g. ffi and gettext on PHP 8.5): nothing to install.
echo "Extension ${EXTENSION} is already provided, skipping package installation"
else
set -e
apt install -y --no-install-recommends php-$PACKAGE_NAME
set +e
PACKAGE_NAME=${PACKAGE_NAME:-$EXTENSION}
if apt-cache search --names-only "php${PHP_VERSION}-$PACKAGE_NAME" | grep "php${PHP_VERSION}-$PACKAGE_NAME"; then
set -e
apt install -y --no-install-recommends php${PHP_VERSION}-$PACKAGE_NAME
else
set -e
apt install -y --no-install-recommends php-$PACKAGE_NAME
fi
fi

fi

if [ -n "$PECL_EXTENSION" ]; then
Expand Down
2 changes: 2 additions & 0 deletions extensions/core/ffi/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

set -e
export EXTENSION=ffi
# php -m displays "FFI" (uppercase)
export PHP_EXT_PHP_NAME=FFI

../docker-install.sh
6 changes: 6 additions & 0 deletions extensions/core/inotify/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -e
export EXTENSION=inotify

../docker-install.sh
14 changes: 13 additions & 1 deletion extensions/core/install_all.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

set -e
set -o pipefail
set +x

# Let's disable autoclean of package list after apt install
Expand All @@ -10,18 +11,29 @@ apt update

mkdir -p /var/log/ext-php/

FAILED_EXTENSIONS=()

for ext in */; do \
cd $ext
ext_no_slash=${ext%/}
echo "***************** Installing $ext_no_slash ******************"
LOG="/var/log/ext-php/install-${ext_no_slash}"
start=$(date +%s)
./install.sh 2>&1 | tee -a "${LOG}.log"
if ! ./install.sh 2>&1 | tee -a "${LOG}.log"; then
FAILED_EXTENSIONS+=("${ext_no_slash}")
# Disable the failed extension so that it does not break the checks of the next ones
phpdismod -v "${PHP_VERSION}" "${ext_no_slash}" || true
fi
end=$(date +%s)
echo "$(($end-$start)) seconds to execute ${ext_no_slash}" > "${LOG}.time"
cd ..
done

if [ ${#FAILED_EXTENSIONS[@]} -ne 0 ]; then
echo "***************** Failed extensions: ${FAILED_EXTENSIONS[*]} ******************"
exit 1
fi

# Let's enable autoclean again
mv /tmp/docker-clean /etc/apt/apt.conf.d/docker-clean

Expand Down
6 changes: 6 additions & 0 deletions extensions/core/lz4/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -e
export EXTENSION=lz4

../docker-install.sh
7 changes: 7 additions & 0 deletions extensions/core/odbc/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -e
# Installs both odbc and pdo_odbc
export EXTENSION=odbc

../docker-install.sh
6 changes: 3 additions & 3 deletions extensions/core/rdkafka/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
export DEV_DEPENDENCIES="librdkafka-dev"
export DEPENDENCIES="librdkafka1"
PECL_EXTENSION=rdkafka ../docker-install.sh
export EXTENSION=rdkafka

../docker-install.sh
3 changes: 3 additions & 0 deletions extensions/core/swoole/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
set -e
export EXTENSION=swoole

# swoole requires mysqlnd to be loaded (installed by pdo_mysql)
phpenmod -v $PHP_VERSION mysqlnd
../docker-install.sh
phpdismod -v $PHP_VERSION mysqlnd
8 changes: 0 additions & 8 deletions extensions/core/weakref/install.sh

This file was deleted.

6 changes: 6 additions & 0 deletions extensions/core/zstd/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -e
export EXTENSION=zstd

../docker-install.sh
2 changes: 1 addition & 1 deletion tests-suite/config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
export PLATFORM="${PLATFORM:-$(uname -p)}"
export PLATFORM="${PLATFORM:-$(docker version -f '{{.Server.Os}}/{{.Server.Arch}}')}"
export BUILDTOOL="build --platform=${PLATFORM}"
export RUN_OPTIONS="--platform=${PLATFORM}"
export PHP_VERSION=${PHP_VERSION:-8.4}
Expand Down
Loading
Loading