PHP 7.4-FPM with common extensions, sendmail, Xdebug. OS time Asia/Jakarta, PHP stays UTC.
415
PHP 7.4-FPM image with common extensions, sendmail and Xdebug, with the container clock set to Asia/Jakarta (WIB, UTC+7); PHP itself stays on UTC (see Overview).
Note: PHP 7.4 and Debian 11 (bullseye) are end-of-life. This image is meant for legacy applications that still need PHP 7. Packages come from
archive.debian.org, and OS and PHP security fixes are no longer published. Do not expose it to untrusted input without other mitigations.
No build needed. Pull the prebuilt image straight from Docker Hub:
docker pull yohannaftali/php7-fpm
Or reference it in your docker-compose.yml:
services:
php:
image: yohannaftali/php7-fpm:latest
Built FROM php:7-fpm (PHP 7.4.33, Debian 11) and adds:
TZ=Asia/Jakarta for the operating system (date, logs, cron). PHP's date.timezone is intentionally left at its default, UTC, so applications stay timezone-agnostic. Set date_default_timezone_set() or date.timezone yourself if you need local time.gd (freetype, jpeg, webp libs), mysqli, pdo, pdo_mysql, pgsql, pdo_pgsql, xmlrpc, zip, opcache, soap, bcmath, mbstring, pcntl, intl, apcu, xdebug (3.1.6, the last release supporting PHP 7.4).sendmail configured as sendmail_path. The entrypoint restarts it on container start./etc/hosts (needed by sendmail).nano, wget, curl, zip, unzip, and jpegoptim, optipng, pngquant, gifsicle.Xdebug is installed but not started automatically (xdebug.remote_autostart=off). Note that xdebug.remote_* are Xdebug 2 setting names and are ignored by Xdebug 3, so configure it with xdebug.mode and xdebug.client_host through your own ini file.
| Tag | Base image |
|---|---|
latest | php:7-fpm (PHP 7.4.33) |
7.4 | php:7.4-fpm |
services:
php:
image: yohannaftali/php7-fpm:latest
restart: unless-stopped
volumes:
- ./app:/var/www/html
expose:
- "9000"
web:
image: nginx:stable
ports:
- "8080:80"
volumes:
- ./app:/var/www/html:ro
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- php
Verify the image:
docker run --rm yohannaftali/php7-fpm php -v
docker run --rm yohannaftali/php7-fpm date +%Z # WIB
docker run --rm yohannaftali/php7-fpm php -r 'echo date_default_timezone_get();' # UTC (by design)
docker run --rm yohannaftali/php7-fpm php -m
docker login
# latest
docker build -t yohannaftali/php7-fpm:latest .
# specific base tag
docker build --build-arg PHP_VERSION=7.4-fpm -t yohannaftali/php7-fpm:7.4 .
docker push yohannaftali/php7-fpm --all-tags
Multi-arch (amd64 + arm64):
docker buildx build --platform linux/amd64,linux/arm64 \
--build-arg PHP_VERSION=7.4-fpm \
-t yohannaftali/php7-fpm:7.4 --push .
.github/workflows/docker-publish.yml builds and pushes the images on every push to main, weekly, and on manual dispatch. It also syncs this README to the Docker Hub overview and the short description.
Required GitHub repository secrets:
| Secret | Value |
|---|---|
DOCKERHUB_USERNAME | yohannaftali |
DOCKERHUB_TOKEN | Docker Hub access token with Read, Write, Delete scope |
To change which tags are published, edit the include matrix in the workflow and the Tags table above.
README.md by the workflow.short-description), max 100 characters.Helper scripts in scripts/ manage the Docker Hub repository from your machine. They need uv and a .env file (copy .env.example) with DOCKERHUB_USERNAME and DOCKERHUB_TOKEN. There are no other dependencies.
| Command | Action |
|---|---|
(none) / sync | Push README.md as the overview and set the short description |
status | Show description, categories, pull and star counts |
tags | List tags with last update and size |
delete-tag <tag> | Delete a tag |
Bash:
./scripts/dockerhub-update.sh # sync
./scripts/dockerhub-update.sh status
./scripts/dockerhub-update.sh tags
./scripts/dockerhub-update.sh delete-tag 7.4
PowerShell:
.\scripts\dockerhub-update.ps1 # sync
.\scripts\dockerhub-update.ps1 status
.\scripts\dockerhub-update.ps1 tags
.\scripts\dockerhub-update.ps1 delete-tag 7.4
Both wrappers call scripts/dockerhub_update.py through uv run. Set DOCKERHUB_REPO to target a repository other than php7-fpm.
The Dockerfile, GitHub Actions workflow and maintenance scripts live at https://github.com/yohannaftali/dockerhub-yohannaftali-php7-fpm. Open an issue there to report a problem.
The Dockerfile in this repository is provided as-is. PHP is licensed under the PHP License; see the official image for details.
Content type
Image
Digest
sha256:e3532baff…
Size
224.8 MB
Last updated
about 24 hours ago
docker pull yohannaftali/php7-fpm