PHP FPM base images with common libraries and database connectors for building applications
2.4K
Pre-built PHP-FPM base images on Alpine Linux with the most common PHP extensions and database connectors already compiled and enabled.
Compiling PHP extensions (GD, Intl, Imagick, SQL Server drivers, etc.) is the slowest part of most PHP Docker builds. These images do that work once, so your application images can start FROM them and skip straight to copying code and running composer install.
linux/amd64 and linux/arm64| PHP | Base image |
|---|---|
| 7.4 | php:7.4-fpm-alpine |
| 8.2 | php:8.2-fpm-alpine |
| 8.3 | php:8.3-fpm-alpine |
| 8.4 | php:8.4-fpm-alpine |
Warning — PHP 7.4 is for legacy applications only. PHP 7.4 reached end of life in November 2022 and no longer receives security updates. Its use is discouraged; please migrate to PHP 8.2 or newer.
Each PHP version is published in four variants. Pick the smallest one that matches your database.
| Variant | MySQL / MariaDB | PostgreSQL | SQL Server |
|---|---|---|---|
all-db | ✔ | ✔ | ✔ |
mysql | ✔ | ||
pgsql | ✔ | ||
mssql | ✔ |
| Database | PHP extensions | System libraries |
|---|---|---|
| MySQL / MariaDB | mysqli, pdo_mysql | — |
| PostgreSQL | pgsql, pdo_pgsql | postgresql-dev |
| SQL Server | sqlsrv, pdo_sqlsrv (PECL) | Microsoft ODBC Driver 18 (msodbcsql18), mssql-tools18, unixodbc-dev |
SQL Server driver versions: 5.10.1 on PHP 7.4, 5.12.0 on PHP 8.2, latest PECL release on PHP 8.3/8.4.
Core PHP extensions
bcmath, calendar, curl, dom, exif, fileinfo, gd (with JPEG + FreeType), gettext, intl, mbstring, opcache, pcntl, simplexml, soap, sockets, xml, zip
PECL extensions
| Extension | Purpose |
|---|---|
apcu | In-memory user cache (apc.enable_cli=1 enabled) |
imagick | ImageMagick bindings for image processing |
redis | Redis client (6.0.2 on PHP 7.4) |
pcov | Code coverage driver for PHPUnit |
Tools
2.9.5 (/usr/local/bin/composer)git, unzip, curl, openssh-client, gnupg, openssl, ca-certificates, tzdata$PHPIZE_DEPS, autoconf, g++, make, libtool) so you can add further extensions with pecl install / docker-php-ext-installcivirmx/base-php-fpm-alpine:php<PHP_VERSION>-<VARIANT>-<IMAGE_VERSION>
civirmx/base-php-fpm-alpine:php<PHP_VERSION>-<VARIANT>-latest
Examples:
civirmx/base-php-fpm-alpine:php8.4-mysql-latestcivirmx/base-php-fpm-alpine:php8.2-all-db-latestcivirmx/base-php-fpm-alpine:php7.4-mssql-latestFROM civirmx/base-php-fpm-alpine:php8.4-mysql-latest
WORKDIR /var/www/html
COPY composer.json composer.lock ./
RUN composer install --no-dev --no-scripts --no-autoloader
COPY . .
RUN composer dump-autoload --optimize
9000php-fpmVerify installed extensions:
docker run --rm --entrypoint php civirmx/base-php-fpm-alpine:php8.4-all-db-latest -m
all-db, mssql) support amd64 and arm64 only.Content type
Image
Digest
sha256:f623a3b2a…
Size
371.8 MB
Last updated
about 11 hours ago
docker pull civirmx/php-fpm-alpine:php8.4-all-db-latest