# docker-images-php **Repository Path**: mirrors_thecodingmachine/docker-images-php ## Basic Information - **Project Name**: docker-images-php - **Description**: A set of PHP Docker images - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: v5 - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-06 - **Last Updated**: 2026-11-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [DO NOT EDIT THIS FILE]: <> (Make yours changes in /utils/README.blueprint.md) ![Docker PHP Images GitHub workflow](https://github.com/thecodingmachine/docker-images-php/workflows/Docker%20PHP%20Images%20GitHub%20workflow/badge.svg) # General purpose PHP images for Docker > **The fpm variant has a built-in Apache** (`PHP_FPM_WEB_SERVER=apache`): the same features as the `apache` variant, > with 2 to 3 times more traffic served and 4 times less memory ([benchmark](benchmarks/fpm-apache/README.md)). It is > the recommended variant to serve a web application: see [Serving with the fpm variant](docs/fpm.md). This repository contains a set of developer-friendly, general purpose PHP images for Docker. - You can enable or disable the extensions using environment variables. - You can also modify the `php.ini` settings using environment variables. - 2 types available: `slim` (no extensions preloaded) or `fat` (most common PHP extensions are built-in) - 3 variants available: `CLI`, `apache` and `fpm` (with an optional built-in Apache, recommended for web applications) - Fat images are bundled with [Supercronic](https://github.com/aptible/supercronic) which is a Cron compatible task runner. Cron jobs can be configured using environment variables - All images come with [Composer](https://getcomposer.org/) installed - All variants can be installed with or without NodeJS (if you need to build your static assets). - Composer binaries (`vendor/bin` and global binaries) and NodeJS binaries (`node_modules/.bin`) can be run without their path, including with `docker exec` / `docker compose exec` (e.g. `docker compose exec app phpstan`) - Everything is done to limit file permission issues that often arise when using Docker. The image is actively tested on Linux, Windows and MacOS See the [documentation](#documentation) for all the features. ## Images | Name | PHP version | type |variant | NodeJS version | Size |-------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|--------|-----------------|------ | [thecodingmachine/php:8.5-v5-apache](Dockerfile.apache) | `8.5.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-apache.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-apache) | [thecodingmachine/php:8.5-v5-apache-node22](Dockerfile.apache.node) | `8.5.x` | fat | apache | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-apache-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-apache-node22) | [thecodingmachine/php:8.5-v5-apache-node24](Dockerfile.apache.node) | `8.5.x` | fat | apache | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-apache-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-apache-node24) | [thecodingmachine/php:8.5-v5-apache-node26](Dockerfile.apache.node) | `8.5.x` | fat | apache | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-apache-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-apache-node26) | [thecodingmachine/php:8.5-v5-fpm](Dockerfile.fpm) | `8.5.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-fpm) | [thecodingmachine/php:8.5-v5-fpm-node22](Dockerfile.fpm.node) | `8.5.x` | fat | fpm | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-fpm-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-fpm-node22) | [thecodingmachine/php:8.5-v5-fpm-node24](Dockerfile.fpm.node) | `8.5.x` | fat | fpm | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-fpm-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-fpm-node24) | [thecodingmachine/php:8.5-v5-fpm-node26](Dockerfile.fpm.node) | `8.5.x` | fat | fpm | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-fpm-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-fpm-node26) | [thecodingmachine/php:8.5-v5-cli](Dockerfile.cli) | `8.5.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-cli.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-cli) | [thecodingmachine/php:8.5-v5-cli-node22](Dockerfile.cli.node) | `8.5.x` | fat | cli | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-cli-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-cli-node22) | [thecodingmachine/php:8.5-v5-cli-node24](Dockerfile.cli.node) | `8.5.x` | fat | cli | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-cli-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-cli-node24) | [thecodingmachine/php:8.5-v5-cli-node26](Dockerfile.cli.node) | `8.5.x` | fat | cli | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-cli-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-cli-node26) | [thecodingmachine/php:8.5-v5-slim-apache](Dockerfile.slim.apache) | `8.5.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-slim-apache) | [thecodingmachine/php:8.5-v5-slim-fpm](Dockerfile.slim.fpm) | `8.5.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-slim-fpm) | [thecodingmachine/php:8.5-v5-slim-cli](Dockerfile.slim.cli) | `8.5.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.5-v5-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:8.5-v5-slim-cli) | [thecodingmachine/php:8.4-v5-apache](Dockerfile.apache) | `8.4.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-apache.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-apache) | [thecodingmachine/php:8.4-v5-apache-node22](Dockerfile.apache.node) | `8.4.x` | fat | apache | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-apache-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-apache-node22) | [thecodingmachine/php:8.4-v5-apache-node24](Dockerfile.apache.node) | `8.4.x` | fat | apache | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-apache-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-apache-node24) | [thecodingmachine/php:8.4-v5-apache-node26](Dockerfile.apache.node) | `8.4.x` | fat | apache | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-apache-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-apache-node26) | [thecodingmachine/php:8.4-v5-fpm](Dockerfile.fpm) | `8.4.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-fpm) | [thecodingmachine/php:8.4-v5-fpm-node22](Dockerfile.fpm.node) | `8.4.x` | fat | fpm | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-fpm-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-fpm-node22) | [thecodingmachine/php:8.4-v5-fpm-node24](Dockerfile.fpm.node) | `8.4.x` | fat | fpm | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-fpm-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-fpm-node24) | [thecodingmachine/php:8.4-v5-fpm-node26](Dockerfile.fpm.node) | `8.4.x` | fat | fpm | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-fpm-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-fpm-node26) | [thecodingmachine/php:8.4-v5-cli](Dockerfile.cli) | `8.4.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-cli.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-cli) | [thecodingmachine/php:8.4-v5-cli-node22](Dockerfile.cli.node) | `8.4.x` | fat | cli | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-cli-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-cli-node22) | [thecodingmachine/php:8.4-v5-cli-node24](Dockerfile.cli.node) | `8.4.x` | fat | cli | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-cli-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-cli-node24) | [thecodingmachine/php:8.4-v5-cli-node26](Dockerfile.cli.node) | `8.4.x` | fat | cli | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-cli-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-cli-node26) | [thecodingmachine/php:8.4-v5-slim-apache](Dockerfile.slim.apache) | `8.4.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-slim-apache) | [thecodingmachine/php:8.4-v5-slim-fpm](Dockerfile.slim.fpm) | `8.4.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-slim-fpm) | [thecodingmachine/php:8.4-v5-slim-cli](Dockerfile.slim.cli) | `8.4.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.4-v5-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:8.4-v5-slim-cli) | [thecodingmachine/php:8.3-v5-apache](Dockerfile.apache) | `8.3.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-apache.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-apache) | [thecodingmachine/php:8.3-v5-apache-node22](Dockerfile.apache.node) | `8.3.x` | fat | apache | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-apache-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-apache-node22) | [thecodingmachine/php:8.3-v5-apache-node24](Dockerfile.apache.node) | `8.3.x` | fat | apache | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-apache-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-apache-node24) | [thecodingmachine/php:8.3-v5-apache-node26](Dockerfile.apache.node) | `8.3.x` | fat | apache | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-apache-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-apache-node26) | [thecodingmachine/php:8.3-v5-fpm](Dockerfile.fpm) | `8.3.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-fpm) | [thecodingmachine/php:8.3-v5-fpm-node22](Dockerfile.fpm.node) | `8.3.x` | fat | fpm | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-fpm-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-fpm-node22) | [thecodingmachine/php:8.3-v5-fpm-node24](Dockerfile.fpm.node) | `8.3.x` | fat | fpm | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-fpm-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-fpm-node24) | [thecodingmachine/php:8.3-v5-fpm-node26](Dockerfile.fpm.node) | `8.3.x` | fat | fpm | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-fpm-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-fpm-node26) | [thecodingmachine/php:8.3-v5-cli](Dockerfile.cli) | `8.3.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-cli.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-cli) | [thecodingmachine/php:8.3-v5-cli-node22](Dockerfile.cli.node) | `8.3.x` | fat | cli | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-cli-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-cli-node22) | [thecodingmachine/php:8.3-v5-cli-node24](Dockerfile.cli.node) | `8.3.x` | fat | cli | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-cli-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-cli-node24) | [thecodingmachine/php:8.3-v5-cli-node26](Dockerfile.cli.node) | `8.3.x` | fat | cli | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-cli-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-cli-node26) | [thecodingmachine/php:8.3-v5-slim-apache](Dockerfile.slim.apache) | `8.3.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-slim-apache) | [thecodingmachine/php:8.3-v5-slim-fpm](Dockerfile.slim.fpm) | `8.3.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-slim-fpm) | [thecodingmachine/php:8.3-v5-slim-cli](Dockerfile.slim.cli) | `8.3.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.3-v5-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:8.3-v5-slim-cli) | [thecodingmachine/php:8.2-v5-apache](Dockerfile.apache) | `8.2.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-apache.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-apache) | [thecodingmachine/php:8.2-v5-apache-node22](Dockerfile.apache.node) | `8.2.x` | fat | apache | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-apache-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-apache-node22) | [thecodingmachine/php:8.2-v5-apache-node24](Dockerfile.apache.node) | `8.2.x` | fat | apache | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-apache-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-apache-node24) | [thecodingmachine/php:8.2-v5-apache-node26](Dockerfile.apache.node) | `8.2.x` | fat | apache | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-apache-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-apache-node26) | [thecodingmachine/php:8.2-v5-fpm](Dockerfile.fpm) | `8.2.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-fpm) | [thecodingmachine/php:8.2-v5-fpm-node22](Dockerfile.fpm.node) | `8.2.x` | fat | fpm | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-fpm-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-fpm-node22) | [thecodingmachine/php:8.2-v5-fpm-node24](Dockerfile.fpm.node) | `8.2.x` | fat | fpm | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-fpm-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-fpm-node24) | [thecodingmachine/php:8.2-v5-fpm-node26](Dockerfile.fpm.node) | `8.2.x` | fat | fpm | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-fpm-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-fpm-node26) | [thecodingmachine/php:8.2-v5-cli](Dockerfile.cli) | `8.2.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-cli.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-cli) | [thecodingmachine/php:8.2-v5-cli-node22](Dockerfile.cli.node) | `8.2.x` | fat | cli | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-cli-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-cli-node22) | [thecodingmachine/php:8.2-v5-cli-node24](Dockerfile.cli.node) | `8.2.x` | fat | cli | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-cli-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-cli-node24) | [thecodingmachine/php:8.2-v5-cli-node26](Dockerfile.cli.node) | `8.2.x` | fat | cli | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-cli-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-cli-node26) | [thecodingmachine/php:8.2-v5-slim-apache](Dockerfile.slim.apache) | `8.2.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-slim-apache) | [thecodingmachine/php:8.2-v5-slim-fpm](Dockerfile.slim.fpm) | `8.2.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-slim-fpm) | [thecodingmachine/php:8.2-v5-slim-cli](Dockerfile.slim.cli) | `8.2.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.2-v5-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:8.2-v5-slim-cli) | [thecodingmachine/php:8.1-v5-apache](Dockerfile.apache) | `8.1.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-apache.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-apache) | [thecodingmachine/php:8.1-v5-apache-node20](Dockerfile.apache.node) | `8.1.x` | fat | apache | `20.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-apache-node20.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-apache-node20) | [thecodingmachine/php:8.1-v5-apache-node22](Dockerfile.apache.node) | `8.1.x` | fat | apache | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-apache-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-apache-node22) | [thecodingmachine/php:8.1-v5-apache-node24](Dockerfile.apache.node) | `8.1.x` | fat | apache | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-apache-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-apache-node24) | [thecodingmachine/php:8.1-v5-apache-node26](Dockerfile.apache.node) | `8.1.x` | fat | apache | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-apache-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-apache-node26) | [thecodingmachine/php:8.1-v5-fpm](Dockerfile.fpm) | `8.1.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-fpm) | [thecodingmachine/php:8.1-v5-fpm-node20](Dockerfile.fpm.node) | `8.1.x` | fat | fpm | `20.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-fpm-node20.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-fpm-node20) | [thecodingmachine/php:8.1-v5-fpm-node22](Dockerfile.fpm.node) | `8.1.x` | fat | fpm | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-fpm-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-fpm-node22) | [thecodingmachine/php:8.1-v5-fpm-node24](Dockerfile.fpm.node) | `8.1.x` | fat | fpm | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-fpm-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-fpm-node24) | [thecodingmachine/php:8.1-v5-fpm-node26](Dockerfile.fpm.node) | `8.1.x` | fat | fpm | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-fpm-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-fpm-node26) | [thecodingmachine/php:8.1-v5-cli](Dockerfile.cli) | `8.1.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-cli.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-cli) | [thecodingmachine/php:8.1-v5-cli-node20](Dockerfile.cli.node) | `8.1.x` | fat | cli | `20.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-cli-node20.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-cli-node20) | [thecodingmachine/php:8.1-v5-cli-node22](Dockerfile.cli.node) | `8.1.x` | fat | cli | `22.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-cli-node22.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-cli-node22) | [thecodingmachine/php:8.1-v5-cli-node24](Dockerfile.cli.node) | `8.1.x` | fat | cli | `24.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-cli-node24.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-cli-node24) | [thecodingmachine/php:8.1-v5-cli-node26](Dockerfile.cli.node) | `8.1.x` | fat | cli | `26.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-cli-node26.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-cli-node26) | [thecodingmachine/php:8.1-v5-slim-apache](Dockerfile.slim.apache) | `8.1.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-slim-apache) | [thecodingmachine/php:8.1-v5-slim-fpm](Dockerfile.slim.fpm) | `8.1.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-slim-fpm) | [thecodingmachine/php:8.1-v5-slim-cli](Dockerfile.slim.cli) | `8.1.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:8.1-v5-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:8.1-v5-slim-cli) Note: we also tag patch releases of PHP versions. So you can specify a specific patch release using thecodingmachine/php:**8.4.1**-v5-cli for instance. However, unless you have a **very specific need** (for instance if the latest patch release of PHP introduced regressions), believe you have no valid reason to ask explicitly for 8.4.1 for instance. When 8.4.2 is out, you certainly want to upgrade automatically to this patch release since patch releases contain only bugfixes. Also, we automatically rebuild X.Y images every week, but only the latest X.Y.Z patch release gets a rebuild. The other patch releases are frozen in time and will contain bugs and security issues. So use those with great care. [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 | |----------------|-----------------------------------------------| | 26 | Maintained (until 2029-04-30) | | 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. Critical vulnerabilities may get an exceptional fix: [php2shell](docs/security-php2shell.md) (CVE-2026-109618 and CVE-2026-109619) is fixed in all the v5 images, not in the v4 ones. ## Usage The images are based on Ubuntu 24.04, with PHP from the [Ondřej Surý's PHP repository](https://packages.sury.org/php/). Example with CLI: ```bash $ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app thecodingmachine/php:8.4-v5-cli php your-script.php ``` Example with PHP-FPM and its built-in Apache (in the same container), recommended to serve a web application: ```bash $ docker run -p 80:80 --rm --name my-apache-fpm-app -e PHP_FPM_WEB_SERVER=apache -v "$PWD":/var/www/html thecodingmachine/php:8.4-v5-fpm ``` Example with PHP-FPM alone, behind your own web server: ```bash $ docker run -p 9000:9000 --rm --name my-php-fpm -v "$PWD":/var/www/html thecodingmachine/php:8.4-v5-fpm ``` Example with Apache and `mod_php`: ```bash $ docker run -p 80:80 --rm --name my-apache-php-app -v "$PWD":/var/www/html thecodingmachine/php:8.4-v5-apache ``` Example with Apache + Node 24.x in a Dockerfile: **Dockerfile** ```Dockerfile FROM thecodingmachine/php:8.4-v5-apache-node24 COPY src/ /var/www/html/ RUN composer install RUN npm install RUN npm run build ``` ## Documentation Most features are configured with environment variables: | Topic | Content | Main variables | |----------------------------------------------------|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------| | [PHP extensions](docs/extensions.md) | Extensions of the slim and fat images, enabling them, compiling them in a slim image | `PHP_EXTENSION_*`, `PHP_EXTENSIONS` | | [PHP configuration](docs/php-configuration.md) | Base `php.ini` file and `php.ini` parameters | `TEMPLATE_PHP_INI`, `PHP_INI_*` | | [Variants](docs/variants.md) | *cli*, *apache* (document root, ports, modules, user) and *fpm* (built-in Apache, PHP-FPM) | `APACHE_DOCUMENT_ROOT`, `APACHE_EXTENSION_*`, `PHP_FPM_WEB_SERVER` | | [Serving with the fpm variant](docs/fpm.md) | Built-in Apache or your own web server, constraints of PHP-FPM, migration from *apache* | `PHP_FPM_WEB_SERVER`, `PHP_FPM_PM_*` | | [Processes](docs/processes.md) | Startup commands, cron jobs and daemons run along with the main command | `STARTUP_COMMAND_*`, `CRON_*`, `DAEMON_*` | | [Debugging and profiling](docs/debugging.md) | Xdebug and Blackfire | `PHP_EXTENSION_XDEBUG`, `XDEBUG_CLIENT_HOST`, `BLACKFIRE_AGENT` | | [Advanced features](docs/advanced.md) | Permissions, NodeJS, Composer version, locales, SSH keys, Kubernetes | `DOCKER_USER`, `COMPOSER_VERSION`, `LOCALES` | The slim images install some tools during the build of your image with an ARG before the `FROM`: `PHP_EXTENSIONS`, `INSTALL_CRON`, `INSTALL_LOCALES`, `NODE_VERSION` and `COMPOSER_VERSION`. ## Migrating from older image versions Check the [migration notes](MIGRATING.md). ## Roadmap The v5 images keep receiving fixes and backward compatible features. The next major version, v6, is planned for 2027: Ubuntu 26.04, a FrankenPHP variant and much faster builds. Follow and discuss it in the [roadmap issue](https://github.com/thecodingmachine/docker-images-php/issues/359). ## Contributing The Dockerfiles and this README are generated from the templates of the `utils` directory: see the [contributing guide](docs/contributing.md) to edit, build and test the images. ## Special thanks These images have been strongly inspired by [tetraweb/php](https://hub.docker.com/r/tetraweb/php/).