PHP 8.4.27 FPM (bookworm/alpine) from source. Interim CVE-patched image; use official library/php
239
PHP 8.4.27 (FPM / FastCGI Process Manager) built from source on Debian bookworm, following the official docker-library/php build standard. This tag mirrors the upstream official image structure for 8.4.27, built locally and published here while the corresponding tag was not yet available on the official library/php repository.
PHP 8.4.27 is a security patch release that remediates known
vulnerabilities (CVEs) present in earlier 8.4.x builds. At the time this image
was created, the official library/php repository had reserved the
8.4.27-fpm tag but had not yet published a built image for it, leaving no
patched image to pull.
This repository was built from the official upstream source (same version, same SHA-256, GPG-verified) and published here only as a temporary stop-gap, so that deployments could pick up the security fixes without waiting.
Migrate back to the official image as soon as it is available. Once the official tag is published, switch to it and stop using this one:
FROM php:8.4.27-fpm # official (preferred) # FROM php:8.4.27-fpm-alpineThe official
library/phpimage is the long-term maintained source. This repository will not receive further security updates and should be treated as interim only.
docker pull erelbi/php:8.4.27-fpm
Check the version:
docker run --rm erelbi/php:8.4.27-fpm php -v
# PHP 8.4.27 (cli) ... Zend OPcache v8.4.27
Run a one-off script:
docker run --rm erelbi/php:8.4.27-fpm php -r 'echo PHP_VERSION, PHP_EOL;'
Serve your application code with php-fpm:
docker run -d --name app \
-p 9000:9000 \
-v "$PWD":/var/www/html \
erelbi/php:8.4.27-fpm
Bundled core extensions:
Core, ctype, curl, date, dom, fileinfo, filter, hash, iconv, json, libxml,
mbstring, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, random,
readline, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard,
tokenizer, xml, xmlreader, xmlwriter, Zend OPcache, zlib
The official helper scripts are present, so additional extensions can be added in a child image:
docker-php-ext-installdocker-php-ext-configuredocker-php-ext-enabledocker-php-sourceNote: database drivers such as
pdo_mysql/mysqli, and extensions likegd,intl,zip,bcmathare not compiled into this base tag. Add them in a derived image as shown below.
FROM erelbi/php:8.4.27-fpm
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
libwebp-dev libzip-dev libicu-dev libonig-dev zlib1g-dev; \
rm -rf /var/lib/apt/lists/*
RUN set -eux; \
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \
docker-php-ext-install -j"$(nproc)" \
bcmath gd intl mbstring mysqli opcache pdo_mysql zip; \
docker-php-source delete
# Composer (optional)
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
services:
php:
image: erelbi/php:8.4.27-fpm
volumes:
- ./:/var/www/html
web:
image: nginx:1.27
ports:
- "8080:80"
volumes:
- ./:/var/www/html
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- php
Minimal nginx.conf:
server {
listen 80;
root /var/www/html;
index index.php;
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
A child image can drop the following into
/usr/local/etc/php/conf.d/opcache-recommended.ini:
opcache.memory_consumption=128
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.validate_timestamps=0
https://www.php.net/distributions/php-8.4.27.tar.xzdcf93923b0e38e0d5252b25b796520b5a47761a08b3488b6d0b5d1115764d3f0docker-library/php repository (8.4 / bookworm / fpm).| Tag | PHP | Base | SAPI |
|---|---|---|---|
8.4.27-fpm | 8.4.27 | bookworm | php-fpm |
8.4.27-fpm-alpine | 8.4.27 | alpine 3.24 | php-fpm |
PHP is distributed under the PHP License v3.01.
Image build tooling follows the MIT-licensed docker-library/php project.
Content type
Image
Digest
sha256:ccfb949bb…
Size
42.3 MB
Last updated
5 days ago
docker pull erelbi/php:8.4.27-cli-alpine