Sign inSign up

erelbi/php

By erelbi

•Updated 5 days ago

PHP 8.4.27 FPM (bookworm/alpine) from source. Interim CVE-patched image; use official library/php

Image
Languages & frameworks
0

239

erelbi/php repository overview

⁠php:8.4.27-fpm

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 version: 8.4.27 (NTS — Non Thread Safe)
  • Base OS: Debian GNU/Linux 12 (bookworm)
  • SAPI: php-fpm (FastCGI), listens on port 9000
  • Zend OPcache: bundled and enabled
  • Architecture: linux/amd64

⁠⚠️ Why this image exists (please read)

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-alpine

The official library/php image is the long-term maintained source. This repository will not receive further security updates and should be treated as interim only.


⁠Quick start

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

⁠What's included

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-install
  • docker-php-ext-configure
  • docker-php-ext-enable
  • docker-php-source

Note: database drivers such as pdo_mysql/mysqli, and extensions like gd, intl, zip, bcmath are not compiled into this base tag. Add them in a derived image as shown below.


⁠Extending the image

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

⁠Using with nginx (docker-compose)

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

⁠Build provenance

  • Built from the official PHP source tarball: https://www.php.net/distributions/php-8.4.27.tar.xz
  • SHA-256: dcf93923b0e38e0d5252b25b796520b5a47761a08b3488b6d0b5d1115764d3f0
  • GPG-verified against the upstream PHP release signing keys during build.
  • Build recipe and helper scripts taken unmodified from the official docker-library/php repository (8.4 / bookworm / fpm).

⁠Tags

TagPHPBaseSAPI
8.4.27-fpm8.4.27bookwormphp-fpm
8.4.27-fpm-alpine8.4.27alpine 3.24php-fpm

⁠License

PHP is distributed under the PHP License v3.01⁠. Image build tooling follows the MIT-licensed docker-library/php project.

Tag summary

Content type

Image

Digest

sha256:ccfb949bb…

Size

42.3 MB

Last updated

5 days ago

docker pull erelbi/php:8.4.27-cli-alpine