English | 中文
Custom PHP-FPM base image built on the official php:<version>-fpm-alpine, adding the extensions and frontend tooling our projects need.
Tags 8.0.11-* and 8.1.0RC2-* are end-of-life and affected by CVE-2026-109618 / CVE-2026-109619 (CVSS 9.2, unauthenticated RCE affecting all SAPIs). Do not use them in new deployments.
Recommended tag:
mo2g/php:8.3.36-fpm-alpine3.24-uglify
PHP 8.3.36 is the security release from 2026-10-21 and fixes both CVEs. Published for linux/amd64 and linux/arm64.
<php-version>-fpm-<alpine-version>[-uglify]
The -uglify suffix means uglifyjs and uglifycss are installed for static asset minification.
| Tag | Architectures | Status |
|---|---|---|
8.3.36-fpm-alpine3.24-uglify | amd64 / arm64 | ✅ Recommended |
8.3.8-fpm-alpine3.20-uglify | amd64 / arm64 | ❌ Affected by CVE-2026-109618/109619 — use 8.3.36 |
8.0.11-fpm-alpine3.14-uglify | amd64 | ❌ EOL, affected by CVE-2026-109618/109619 |
8.0.11-fpm-alpine3.14-uglifyjs | amd64 | ❌ EOL, affected by CVE-2026-109618/109619 |
8.1.0RC2-fpm-alpine3.14 | amd64 | ❌ EOL, RC build |
Included in the official image: 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, zlib
Added by this image:
| Category | Extensions |
|---|---|
| Database | mysqli, pdo_mysql |
| Image | gd (freetype + jpeg), exif, imagick |
| Cache | igbinary, redis, memcached (built with --enable-memcached-igbinary) |
| Crypto | mcrypt (PECL, see below) |
| Other | intl, gmp, zip, opcache, sockets, calendar, pcntl, bcmath |
www-data uses UID/GID 48:48 (matching apache) to avoid permission problems on bind-mounted volumes.uglifyjs / uglifycss preinstalled (only on -uglify tags).mcrypt included, because legacy application code depends on MCRYPT_RIJNDAEL_256.docker-php-ext-* artifacts are produced in a multi-stage build, with a build-time self-check that fails the build if any extension is missing.mcrypt was removed from PHP core in 7.2 and is installed here from PECL. Since PECL 1.0.7, every mcrypt_* call emits E_DEPRECATED.
Also note: MCRYPT_RIJNDAEL_256 is the 256-bit block size variant of Rijndael and is not compatible with AES-256. With ECB mode, identical plaintext blocks produce identical ciphertext blocks.
For new projects use openssl_encrypt() with aes-256-gcm instead of this extension.
Multi-stage build on top of php:<version>-fpm-alpine<alpine>:
pecl install igbinary redis mcrypt imagick, configure and compile memcached with igbinary support, then docker-php-ext-install core extensionsextensions and conf.d, install runtime libs (including imagemagick, required by imagick.so)extension_loaded(), fail the build if one is missingdocker buildx build --platform linux/amd64,linux/arm64 \
-t mo2g/php:<tag> --push .
Cross-building amd64 on Apple Silicon runs under QEMU and takes ~45 minutes; native amd64 on Linux takes ~5 minutes.
基于官方 php:<version>-fpm-alpine 构建的自用 PHP-FPM 镜像,补齐业务所需的扩展与前端构建工具。
标签 8.0.11-* 与 8.1.0RC2-* 均已 EOL,且受影响于 CVE-2026-109618 / CVE-2026-109619(CVSS 9.2,未认证 RCE,影响所有 SAPI)。请勿用于新环境。
当前推荐:
mo2g/php:8.3.36-fpm-alpine3.24-uglify
PHP 8.3.36 是 2026-10-21 的安全版本,已修复上述两个 CVE,同时提供 linux/amd64 与 linux/arm64。
<PHP 版本>-fpm-<Alpine 版本>[-uglify]
-uglify 后缀表示镜像内额外安装了 uglifyjs 与 uglifycss,用于静态资源压缩。
| 标签 | 架构 | 状态 |
|---|---|---|
8.3.36-fpm-alpine3.24-uglify | amd64 / arm64 | ✅ 推荐 |
8.3.8-fpm-alpine3.20-uglify | amd64 / arm64 | ❌ 受影响于 CVE-2026-109618/109619,请改用 8.3.36 |
8.0.11-fpm-alpine3.14-uglify | amd64 | ❌ EOL,含 CVE-2026-109618/109619 |
8.0.11-fpm-alpine3.14-uglifyjs | amd64 | ❌ EOL,含 CVE-2026-109618/109619 |
8.1.0RC2-fpm-alpine3.14 | amd64 | ❌ EOL,RC 版本 |
官方镜像自带: 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、zlib
本镜像额外编译:
| 类型 | 扩展 |
|---|---|
| 数据库 | mysqli、pdo_mysql |
| 图像 | gd(freetype + jpeg)、exif、imagick |
| 缓存 | igbinary、redis、memcached(带 --enable-memcached-igbinary) |
| 加密 | mcrypt(PECL,见下文) |
| 其他 | intl、gmp、zip、opcache、sockets、calendar、pcntl、bcmath |
www-data 的 UID/GID 改为 48:48(与 apache 一致),解决宿主机挂载目录的读写权限问题。uglifyjs / uglifycss(仅 -uglify 标签)。mcrypt,因为存量业务代码依赖 MCRYPT_RIJNDAEL_256。docker-php-ext-* 产物由多阶段构建产出,构建期逐个校验扩展是否加载,缺一个即构建失败。mcrypt 自 PHP 7.2 起已移出核心,本镜像通过 PECL 安装。自 PECL 1.0.7 起,mcrypt_* 函数每次调用都会产生 E_DEPRECATED 告警。
同时注意:MCRYPT_RIJNDAEL_256 是 256 位分组的 Rijndael 变体,与 AES-256 不兼容;若使用 ECB 模式,相同明文块会产生相同密文块。
新项目请直接使用 openssl_encrypt() + aes-256-gcm,不要引入该扩展。
基于 php:<version>-fpm-alpine<alpine> 的多阶段构建:
pecl install igbinary redis mcrypt imagick,自行 configure 编译 memcached(带 igbinary 支持),再 docker-php-ext-install 核心扩展extensions 与 conf.d,安装运行期依赖(含 imagemagick,供 imagick.so 加载)extension_loaded() 校验,缺一个就失败docker buildx build --platform linux/amd64,linux/arm64 \
-t mo2g/php:<tag> --push .
在 Apple Silicon 上交叉构建 amd64 需 QEMU 模拟,耗时约 45 分钟;Linux 主机原生构建约 5 分钟。
Content type
Image
Digest
sha256:17e6ca64c…
Size
69.8 MB
Last updated
21 days ago
docker pull mo2g/php:8.3.36-fpm-alpine3.24-uglify