<!--

********************************************************************************

WARNING:

    DO NOT EDIT "php/README.md"

    IT IS AUTO-GENERATED

    (from the other files in "php/" combined with a set of templates)

********************************************************************************

-->

**Note:** this is the "per-architecture" repository for the `arm32v6` builds of [the `php` official image](https://hub.docker.com/_/php) -- for more information, see ["Architectures other than amd64?" in the official images documentation](https://github.com/docker-library/official-images#architectures-other-than-amd64) and ["An image's source changed in Git, now what?" in the official images FAQ](https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what).

# Quick reference

-	**Maintained by**:  
	[the Docker Community](https://github.com/docker-library/php)

-	**Where to get help**:  
	[the Docker Community Slack](https://dockr.ly/comm-slack), [Server Fault](https://serverfault.com/help/on-topic), [Unix & Linux](https://unix.stackexchange.com/help/on-topic), or [Stack Overflow](https://stackoverflow.com/help/on-topic)

# Supported tags and respective `Dockerfile` links

-	[`8.5.6RC1-cli-alpine3.23`, `8.5-rc-cli-alpine3.23`, `8.5.6RC1-alpine3.23`, `8.5-rc-alpine3.23`, `8.5.6RC1-cli-alpine`, `8.5-rc-cli-alpine`, `8.5.6RC1-alpine`, `8.5-rc-alpine`](https://github.com/docker-library/php/blob/8d5174f798a4b61c661c10614784827aa6fc525f/8.5-rc/alpine3.23/cli/Dockerfile)

-	[`8.5.6RC1-fpm-alpine3.23`, `8.5-rc-fpm-alpine3.23`, `8.5.6RC1-fpm-alpine`, `8.5-rc-fpm-alpine`](https://github.com/docker-library/php/blob/8d5174f798a4b61c661c10614784827aa6fc525f/8.5-rc/alpine3.23/fpm/Dockerfile)

-	[`8.5.6RC1-zts-alpine3.23`, `8.5-rc-zts-alpine3.23`, `8.5.6RC1-zts-alpine`, `8.5-rc-zts-alpine`](https://github.com/docker-library/php/blob/8d5174f798a4b61c661c10614784827aa6fc525f/8.5-rc/alpine3.23/zts/Dockerfile)

-	[`8.5.6RC1-cli-alpine3.22`, `8.5-rc-cli-alpine3.22`, `8.5.6RC1-alpine3.22`, `8.5-rc-alpine3.22`](https://github.com/docker-library/php/blob/8d5174f798a4b61c661c10614784827aa6fc525f/8.5-rc/alpine3.22/cli/Dockerfile)

-	[`8.5.6RC1-fpm-alpine3.22`, `8.5-rc-fpm-alpine3.22`](https://github.com/docker-library/php/blob/8d5174f798a4b61c661c10614784827aa6fc525f/8.5-rc/alpine3.22/fpm/Dockerfile)

-	[`8.5.6RC1-zts-alpine3.22`, `8.5-rc-zts-alpine3.22`](https://github.com/docker-library/php/blob/8d5174f798a4b61c661c10614784827aa6fc525f/8.5-rc/alpine3.22/zts/Dockerfile)

-	[`8.5.5-cli-alpine3.23`, `8.5-cli-alpine3.23`, `8-cli-alpine3.23`, `cli-alpine3.23`, `8.5.5-alpine3.23`, `8.5-alpine3.23`, `8-alpine3.23`, `alpine3.23`, `8.5.5-cli-alpine`, `8.5-cli-alpine`, `8-cli-alpine`, `cli-alpine`, `8.5.5-alpine`, `8.5-alpine`, `8-alpine`, `alpine`](https://github.com/docker-library/php/blob/992f68ff3c761d3c8702d7de77b47ce980d4d1aa/8.5/alpine3.23/cli/Dockerfile)

-	[`8.5.5-fpm-alpine3.23`, `8.5-fpm-alpine3.23`, `8-fpm-alpine3.23`, `fpm-alpine3.23`, `8.5.5-fpm-alpine`, `8.5-fpm-alpine`, `8-fpm-alpine`, `fpm-alpine`](https://github.com/docker-library/php/blob/992f68ff3c761d3c8702d7de77b47ce980d4d1aa/8.5/alpine3.23/fpm/Dockerfile)

-	[`8.5.5-zts-alpine3.23`, `8.5-zts-alpine3.23`, `8-zts-alpine3.23`, `zts-alpine3.23`, `8.5.5-zts-alpine`, `8.5-zts-alpine`, `8-zts-alpine`, `zts-alpine`](https://github.com/docker-library/php/blob/992f68ff3c761d3c8702d7de77b47ce980d4d1aa/8.5/alpine3.23/zts/Dockerfile)

-	[`8.5.5-cli-alpine3.22`, `8.5-cli-alpine3.22`, `8-cli-alpine3.22`, `cli-alpine3.22`, `8.5.5-alpine3.22`, `8.5-alpine3.22`, `8-alpine3.22`, `alpine3.22`](https://github.com/docker-library/php/blob/992f68ff3c761d3c8702d7de77b47ce980d4d1aa/8.5/alpine3.22/cli/Dockerfile)

-	[`8.5.5-fpm-alpine3.22`, `8.5-fpm-alpine3.22`, `8-fpm-alpine3.22`, `fpm-alpine3.22`](https://github.com/docker-library/php/blob/992f68ff3c761d3c8702d7de77b47ce980d4d1aa/8.5/alpine3.22/fpm/Dockerfile)

-	[`8.5.5-zts-alpine3.22`, `8.5-zts-alpine3.22`, `8-zts-alpine3.22`, `zts-alpine3.22`](https://github.com/docker-library/php/blob/992f68ff3c761d3c8702d7de77b47ce980d4d1aa/8.5/alpine3.22/zts/Dockerfile)

-	[`8.4.21RC1-cli-alpine3.23`, `8.4-rc-cli-alpine3.23`, `8.4.21RC1-alpine3.23`, `8.4-rc-alpine3.23`, `8.4.21RC1-cli-alpine`, `8.4-rc-cli-alpine`, `8.4.21RC1-alpine`, `8.4-rc-alpine`](https://github.com/docker-library/php/blob/b7b08a84c5505f2435125b87e1f027faf0d569c4/8.4-rc/alpine3.23/cli/Dockerfile)

-	[`8.4.21RC1-fpm-alpine3.23`, `8.4-rc-fpm-alpine3.23`, `8.4.21RC1-fpm-alpine`, `8.4-rc-fpm-alpine`](https://github.com/docker-library/php/blob/b7b08a84c5505f2435125b87e1f027faf0d569c4/8.4-rc/alpine3.23/fpm/Dockerfile)

-	[`8.4.21RC1-zts-alpine3.23`, `8.4-rc-zts-alpine3.23`, `8.4.21RC1-zts-alpine`, `8.4-rc-zts-alpine`](https://github.com/docker-library/php/blob/b7b08a84c5505f2435125b87e1f027faf0d569c4/8.4-rc/alpine3.23/zts/Dockerfile)

-	[`8.4.21RC1-cli-alpine3.22`, `8.4-rc-cli-alpine3.22`, `8.4.21RC1-alpine3.22`, `8.4-rc-alpine3.22`](https://github.com/docker-library/php/blob/b7b08a84c5505f2435125b87e1f027faf0d569c4/8.4-rc/alpine3.22/cli/Dockerfile)

-	[`8.4.21RC1-fpm-alpine3.22`, `8.4-rc-fpm-alpine3.22`](https://github.com/docker-library/php/blob/b7b08a84c5505f2435125b87e1f027faf0d569c4/8.4-rc/alpine3.22/fpm/Dockerfile)

-	[`8.4.21RC1-zts-alpine3.22`, `8.4-rc-zts-alpine3.22`](https://github.com/docker-library/php/blob/b7b08a84c5505f2435125b87e1f027faf0d569c4/8.4-rc/alpine3.22/zts/Dockerfile)

-	[`8.4.20-cli-alpine3.23`, `8.4-cli-alpine3.23`, `8.4.20-alpine3.23`, `8.4-alpine3.23`, `8.4.20-cli-alpine`, `8.4-cli-alpine`, `8.4.20-alpine`, `8.4-alpine`](https://github.com/docker-library/php/blob/df331bd9f2935b52b893459479b7dbd60b38bbd4/8.4/alpine3.23/cli/Dockerfile)

-	[`8.4.20-fpm-alpine3.23`, `8.4-fpm-alpine3.23`, `8.4.20-fpm-alpine`, `8.4-fpm-alpine`](https://github.com/docker-library/php/blob/df331bd9f2935b52b893459479b7dbd60b38bbd4/8.4/alpine3.23/fpm/Dockerfile)

-	[`8.4.20-zts-alpine3.23`, `8.4-zts-alpine3.23`, `8.4.20-zts-alpine`, `8.4-zts-alpine`](https://github.com/docker-library/php/blob/df331bd9f2935b52b893459479b7dbd60b38bbd4/8.4/alpine3.23/zts/Dockerfile)

-	[`8.4.20-cli-alpine3.22`, `8.4-cli-alpine3.22`, `8.4.20-alpine3.22`, `8.4-alpine3.22`](https://github.com/docker-library/php/blob/df331bd9f2935b52b893459479b7dbd60b38bbd4/8.4/alpine3.22/cli/Dockerfile)

-	[`8.4.20-fpm-alpine3.22`, `8.4-fpm-alpine3.22`](https://github.com/docker-library/php/blob/df331bd9f2935b52b893459479b7dbd60b38bbd4/8.4/alpine3.22/fpm/Dockerfile)

-	[`8.4.20-zts-alpine3.22`, `8.4-zts-alpine3.22`](https://github.com/docker-library/php/blob/df331bd9f2935b52b893459479b7dbd60b38bbd4/8.4/alpine3.22/zts/Dockerfile)

-	[`8.3.30-cli-alpine3.23`, `8.3-cli-alpine3.23`, `8.3.30-alpine3.23`, `8.3-alpine3.23`, `8.3.30-cli-alpine`, `8.3-cli-alpine`, `8.3.30-alpine`, `8.3-alpine`](https://github.com/docker-library/php/blob/9bd420f925594037d42fb75ce811c9eb537e6385/8.3/alpine3.23/cli/Dockerfile)

-	[`8.3.30-fpm-alpine3.23`, `8.3-fpm-alpine3.23`, `8.3.30-fpm-alpine`, `8.3-fpm-alpine`](https://github.com/docker-library/php/blob/3a74db043f304883e3553bdca969363399c87b5f/8.3/alpine3.23/fpm/Dockerfile)

-	[`8.3.30-zts-alpine3.23`, `8.3-zts-alpine3.23`, `8.3.30-zts-alpine`, `8.3-zts-alpine`](https://github.com/docker-library/php/blob/9bd420f925594037d42fb75ce811c9eb537e6385/8.3/alpine3.23/zts/Dockerfile)

-	[`8.3.30-cli-alpine3.22`, `8.3-cli-alpine3.22`, `8.3.30-alpine3.22`, `8.3-alpine3.22`](https://github.com/docker-library/php/blob/9bd420f925594037d42fb75ce811c9eb537e6385/8.3/alpine3.22/cli/Dockerfile)

-	[`8.3.30-fpm-alpine3.22`, `8.3-fpm-alpine3.22`](https://github.com/docker-library/php/blob/3a74db043f304883e3553bdca969363399c87b5f/8.3/alpine3.22/fpm/Dockerfile)

-	[`8.3.30-zts-alpine3.22`, `8.3-zts-alpine3.22`](https://github.com/docker-library/php/blob/9bd420f925594037d42fb75ce811c9eb537e6385/8.3/alpine3.22/zts/Dockerfile)

-	[`8.2.30-cli-alpine3.23`, `8.2-cli-alpine3.23`, `8.2.30-alpine3.23`, `8.2-alpine3.23`, `8.2.30-cli-alpine`, `8.2-cli-alpine`, `8.2.30-alpine`, `8.2-alpine`](https://github.com/docker-library/php/blob/6485b53a1da0f2c4c5b564808de75ae62c023286/8.2/alpine3.23/cli/Dockerfile)

-	[`8.2.30-fpm-alpine3.23`, `8.2-fpm-alpine3.23`, `8.2.30-fpm-alpine`, `8.2-fpm-alpine`](https://github.com/docker-library/php/blob/6485b53a1da0f2c4c5b564808de75ae62c023286/8.2/alpine3.23/fpm/Dockerfile)

-	[`8.2.30-zts-alpine3.23`, `8.2-zts-alpine3.23`, `8.2.30-zts-alpine`, `8.2-zts-alpine`](https://github.com/docker-library/php/blob/6485b53a1da0f2c4c5b564808de75ae62c023286/8.2/alpine3.23/zts/Dockerfile)

-	[`8.2.30-cli-alpine3.22`, `8.2-cli-alpine3.22`, `8.2.30-alpine3.22`, `8.2-alpine3.22`](https://github.com/docker-library/php/blob/6485b53a1da0f2c4c5b564808de75ae62c023286/8.2/alpine3.22/cli/Dockerfile)

-	[`8.2.30-fpm-alpine3.22`, `8.2-fpm-alpine3.22`](https://github.com/docker-library/php/blob/6485b53a1da0f2c4c5b564808de75ae62c023286/8.2/alpine3.22/fpm/Dockerfile)

-	[`8.2.30-zts-alpine3.22`, `8.2-zts-alpine3.22`](https://github.com/docker-library/php/blob/6485b53a1da0f2c4c5b564808de75ae62c023286/8.2/alpine3.22/zts/Dockerfile)

# Quick reference (cont.)

-	**Where to file issues**:  
	[https://github.com/docker-library/php/issues](https://github.com/docker-library/php/issues?q=)

-	**Supported architectures**: ([more info](https://github.com/docker-library/official-images#architectures-other-than-amd64))  
	[`amd64`](https://hub.docker.com/r/amd64/php/), [`arm32v5`](https://hub.docker.com/r/arm32v5/php/), [`arm32v6`](https://hub.docker.com/r/arm32v6/php/), [`arm32v7`](https://hub.docker.com/r/arm32v7/php/), [`arm64v8`](https://hub.docker.com/r/arm64v8/php/), [`i386`](https://hub.docker.com/r/i386/php/), [`mips64le`](https://hub.docker.com/r/mips64le/php/), [`ppc64le`](https://hub.docker.com/r/ppc64le/php/), [`riscv64`](https://hub.docker.com/r/riscv64/php/), [`s390x`](https://hub.docker.com/r/s390x/php/)

-	**Published image artifact details**:  
	[repo-info repo's `repos/php/` directory](https://github.com/docker-library/repo-info/blob/master/repos/php) ([history](https://github.com/docker-library/repo-info/commits/master/repos/php))  
	(image metadata, transfer size, etc)

-	**Image updates**:  
	[official-images repo's `library/php` label](https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fphp)  
	[official-images repo's `library/php` file](https://github.com/docker-library/official-images/blob/master/library/php) ([history](https://github.com/docker-library/official-images/commits/master/library/php))

-	**Source of this description**:  
	[docs repo's `php/` directory](https://github.com/docker-library/docs/tree/master/php) ([history](https://github.com/docker-library/docs/commits/master/php))

# What is PHP?

PHP is a server-side scripting language designed for web development, but which can also be used as a general-purpose programming language. PHP can be added to straight HTML or it can be used with a variety of templating engines and web frameworks. PHP code is usually processed by an interpreter, which is either implemented as a native module on the web-server or as a common gateway interface (CGI).

> [wikipedia.org/wiki/PHP](https://en.wikipedia.org/wiki/PHP)

![logo](https://raw.githubusercontent.com/docker-library/docs/01c12653951b2fe592c1f93a13b4e289ada0e3a1/php/logo.png)

# How to use this image

### Create a `Dockerfile` in your PHP project

```dockerfile
FROM arm32v6/php:8.2-cli
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
CMD [ "php", "./your-script.php" ]
```

Then, run the commands to build and run the Docker image:

```console
$ docker build -t my-php-app .
$ docker run -it --rm --name my-running-app my-php-app
```

### Run a single PHP script

For many simple, single file projects, you may find it inconvenient to write a complete `Dockerfile`. In such cases, you can run a PHP script by using the PHP Docker image directly:

```console
$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp arm32v6/php:8.2-cli php your-script.php
```

## How to install more PHP extensions

Many extensions are already compiled into the image, so it's worth checking the output of `php -m` or `php -i` before going through the effort of compiling more.

We provide the helper scripts `docker-php-ext-configure`, `docker-php-ext-install`, and `docker-php-ext-enable` to more easily install PHP extensions.

In order to keep the images smaller, PHP's source is kept in a compressed tar file. To facilitate linking of PHP's source with any extension, we also provide the helper script `docker-php-source` to easily extract the tar or delete the extracted source. Note: if you do use `docker-php-source` to extract the source, be sure to delete it in the same layer of the docker image.

```Dockerfile
FROM arm32v6/php:8.2-cli
RUN docker-php-source extract \
	# do important things \
	&& docker-php-source delete
```

### PHP Core Extensions

For example, if you want to have a PHP-FPM image with the `gd` extension, you can inherit the base image that you like, and write your own `Dockerfile` like this:

```dockerfile
FROM arm32v6/php:8.2-fpm
RUN apt-get update && apt-get install -y \
		libfreetype-dev \
		libjpeg62-turbo-dev \
		libpng-dev \
	&& docker-php-ext-configure gd --with-freetype --with-jpeg \
	&& docker-php-ext-install -j$(nproc) gd
```

Remember, you must install dependencies for your extensions manually. If an extension needs custom `configure` arguments, you can use the `docker-php-ext-configure` script like this example. There is no need to run `docker-php-source` manually in this case, since that is handled by the `configure` and `install` scripts.

If you are having difficulty figuring out which Debian or Alpine packages need to be installed before `docker-php-ext-install`, then have a look at [the `install-php-extensions` project](https://github.com/mlocati/docker-php-extension-installer). This script builds upon the `docker-php-ext-*` scripts and simplifies the installation of PHP extensions by automatically adding and removing Debian (apt) and Alpine (apk) packages. For example, to install the GD extension you simply have to run `install-php-extensions gd`. This tool is contributed by community members and is not included in the images, please refer to their Git repository for installation, usage, and issues.

See also ["Dockerizing Compiled Software"](https://tianon.xyz/post/2017/12/26/dockerize-compiled-software.html) for a description of the technique Tianon uses for determining the necessary build-time dependencies for any bit of software (which applies directly to compiling PHP extensions).

### Default extensions

Some extensions are compiled by default. This depends on the PHP version you are using. Run `php -m` in the container to get a list for your specific version.

### PECL extensions

Some extensions are not provided with the PHP source, but are instead available through [PECL](https://pecl.php.net/). To install a PECL extension, use `pecl install` to download and compile it, then use `docker-php-ext-enable` to enable it:

```dockerfile
FROM arm32v6/php:8.2-cli
RUN pecl install redis-5.3.7 \
	&& pecl install xdebug-3.2.1 \
	&& docker-php-ext-enable redis xdebug
```

```dockerfile
FROM arm32v6/php:8.2-cli
RUN apt-get update && apt-get install -y libmemcached-dev libssl-dev zlib1g-dev \
	&& pecl install memcached-3.2.0 \
	&& docker-php-ext-enable memcached
```

It is *strongly* recommended that users use an explicit version number in their `pecl install` invocations to ensure proper PHP version compatibility (PECL does not check the PHP version compatibility when choosing a version of the extension to install, but does when trying to install it). Beyond the compatibility issue, it's also a good practice to ensure you know when your dependencies receive updates and can control those updates directly.

Unlike PHP core extensions, PECL extensions should be installed in series to fail properly if something went wrong. Otherwise errors are just skipped by PECL. For example, `pecl install memcached-3.2.0 && pecl install redis-5.3.7` instead of `pecl install memcached-3.2.0 redis-5.3.7`. However, `docker-php-ext-enable memcached redis` is fine to be all in one command.

### Other extensions

Some extensions are not provided via either Core or PECL; these can be installed too, although the process is less automated:

```dockerfile
FROM arm32v6/php:8.2-cli
RUN curl -fsSL '[url-to-custom-php-module]' -o module-name.tar.gz \
	&& mkdir -p module-name \
	&& sha256sum -c "[shasum-value]  module-name.tar.gz" \
	&& tar -xf module-name.tar.gz -C module-name --strip-components=1 \
	&& rm module-name.tar.gz \
	&& ( \
		cd module-name \
		&& phpize \
		&& ./configure --enable-module-name \
		&& make -j "$(nproc)" \
		&& make install \
	) \
	&& rm -r module-name \
	&& docker-php-ext-enable module-name
```

The `docker-php-ext-*` scripts *can* accept an arbitrary path, but it must be absolute (to disambiguate from built-in extension names), so the above example could also be written as the following:

```dockerfile
FROM arm32v6/php:8.2-cli
RUN curl -fsSL '[url-to-custom-php-module]' -o module-name.tar.gz \
	&& mkdir -p /tmp/module-name \
	&& sha256sum -c "[shasum-value]  module-name.tar.gz" \
	&& tar -xf module-name.tar.gz -C /tmp/module-name --strip-components=1 \
	&& rm module-name.tar.gz \
	&& docker-php-ext-configure /tmp/module-name --enable-module-name \
	&& docker-php-ext-install /tmp/module-name \
	&& rm -r /tmp/module-name
```

## Running as an arbitrary user

For running the Apache variants as an arbitrary user, there are a couple choices:

-	If your kernel [is version 4.11 or newer](https://github.com/moby/moby/issues/8460#issuecomment-312459310), you can add `--sysctl net.ipv4.ip_unprivileged_port_start=0` (which [will be the default in a future version of Docker](https://github.com/moby/moby/pull/41030)) and then `--user` should work as it does for FPM.
-	If you adjust the Apache configuration to use an "unprivileged" port (greater than 1024 by default), then `--user` should work as it does for FPM regardless of kernel version.

For running the FPM variants as an arbitrary user, the `--user` flag to `docker run` should be used (which can accept both a username/group in the container's `/etc/passwd` file like `--user daemon` or a specific UID/GID like `--user 1000:1000`).

## "`E: Package 'php-XXX' has no installation candidate`"

As of [docker-library/php#542](https://github.com/docker-library/php/pull/542), this image blocks the installation of Debian's PHP packages. There is some additional discussion of this change in [docker-library/php#551 (comment)](https://github.com/docker-library/php/issues/551#issuecomment-354849074), but the gist is that installing Debian's PHP packages in this image leads to two conflicting installations of PHP in a single image, which is almost certainly not the intended outcome.

For those broken by this change and looking for a workaround to apply in the meantime while a proper fix is developed, adding the following simple line to your `Dockerfile` should remove the block (**with the strong caveat that this will allow the installation of a second installation of PHP, which is definitely not what you're looking for unless you *really* know what you're doing**):

```dockerfile
RUN rm /etc/apt/preferences.d/no-debian-php
```

The *proper* solution to this error is to either use `FROM debian:XXX` and install Debian's PHP packages directly, or to use `docker-php-ext-install`, `pecl`, and/or `phpize` to install the necessary additional extensions and utilities.

## Configuration

This image ships with the default [`php.ini-development`](https://github.com/php/php-src/blob/master/php.ini-development) and [`php.ini-production`](https://github.com/php/php-src/blob/master/php.ini-production) configuration files.

It is *strongly* recommended to use the production config for images used in production environments!

The default config can be customized by copying configuration files into the `$PHP_INI_DIR/conf.d/` directory.

### Example

```dockerfile
FROM arm32v6/php:8.2-fpm-alpine

# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
```

In many production environments, it is also recommended to (build and) enable the PHP core OPcache extension for performance. See [the upstream OPcache documentation](https://www.php.net/manual/en/book.opcache.php) for more details.

# Image Variants

The `arm32v6/php` images come in many flavors, each designed for a specific use case.

## `arm32v6/php:<version>-cli`

This variant contains the [PHP CLI](https://secure.php.net/manual/en/features.commandline.php) tool with default mods. If you need a web server, this is probably not the image you are looking for. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as a base from which to build other images.

It also is the only variant which contains the (not recommended) `php-cgi` binary, which is likely necessary for some things like [PPM](https://github.com/php-pm/php-pm).

Note that *all* variants of `arm32v6/php` contain the PHP CLI (`/usr/local/bin/php`).

## `arm32v6/php:<version>-alpine`

This image is based on the popular [Alpine Linux project](https://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.

This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use [musl libc](https://musl.libc.org) instead of [glibc and friends](https://www.etalabs.net/compare_libcs.html), so software will often run into issues depending on the depth of their libc requirements/assumptions. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.

To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).

## `arm32v6/php:<version>-fpm`

This variant contains [PHP's FastCGI Process Manager (FPM)](https://www.php.net/fpm), which is the recommended FastCGI implementation for PHP.

In order to use this image variant, some kind of reverse proxy (such as NGINX, Apache, or other tool which speaks the FastCGI protocol) will be required.

**WARNING:** the FastCGI protocol is inherently trusting, and thus *extremely* insecure to expose outside of a private container network -- unless you know *exactly* what you are doing (and are willing to accept the extreme risk), do not use Docker's `--publish` (`-p`) flag with this image variant.

### FPM configuration

This variant has a few FPM configuration files, each providing a small set of directives.

-	`/usr/local/etc/php-fpm.conf`: This is the PHP upstream-provided main configuration file. The only thing that isn't commented out is the `include` for `php-fpm.d/*.conf` under the `[global]` section.
-	`/usr/local/etc/php-fpm.d/docker.conf`: This is image specific configuration that makes FPM easier to run under Docker. With understanding, these may be overridden in user provided configuration.
-	`/usr/local/etc/php-fpm.d/www.conf`: This is the PHP upstream-provided `www` pool configuration with minor modifications for the image. This may be edited, replaced, or overridden in later configuration files as needed.
-	`/usr/local/etc/php-fpm.d/zz-docker.conf`: As of January 2026, this only contains `daemonize = no` under the `[global]` directive. This should not be overridden.

It is recommended to place user configuration in its own `.conf` file within `/usr/local/etc/php-fpm.d/`. Files are included in glob order, so they are sorted according to the collating sequence in effect in the current locale. Later files can override configuration from previous files. See also [FPM's Official Configuration Reference](https://www.php.net/manual/en/install.fpm.configuration.php).

Below is an example of adding custom FPM configuration using a Dockerfile.

```Dockerfile
FROM php:8-fpm
RUN set -eux; \
	{ \
		echo '[www]'; \
		echo 'pm.status_path = /status'; \
	} > /usr/local/etc/php-fpm.d/my-fpm.conf
```

Alternatively, a bind-mounted file at runtime can be used as long as the container user (`www-data` of the image by default) can read it (e.g. `--mount type=bind,src=path/to/my-fpm.conf,dst=/usr/local/etc/php-fpm.d/my-fpm.conf` on `docker run`). Special care must be taken when mounting a folder of configuration files over the whole `/usr/local/etc/php-fpm.d/` directory (e.g. `--mount type=bind,src=path/to/fpm.d/,dst=/usr/local/etc/php-fpm.d/`); this replaces the `php-fpm.d` directory of the image, so any necessary directives from the image-provided configuration files (like `daemonize = no`) must be in the user-provided files.

Some other potentially helpful resources:

-	[Simplified example by @md5](https://gist.github.com/md5/d9206eacb5a0ff5d6be0)
-	[Very detailed article by Pascal Landau](https://www.pascallandau.com/blog/php-php-fpm-and-nginx-on-docker-in-windows-10/)
-	[Stack Overflow discussion](https://stackoverflow.com/q/29905953/433558)
-	[Apache httpd Wiki example](https://wiki.apache.org/httpd/PHPFPMWordpress)

# License

View [license information](http://php.net/license/) for the software contained in this image.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

Some additional license information which was able to be auto-detected might be found in [the `repo-info` repository's `php/` directory](https://github.com/docker-library/repo-info/tree/master/repos/php).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
