Apache + mod_php images (PHP 8.4/8.3, prod/dev): mount your PHP app at /src and run.
2.8K
Apache + PHP (mod_php) Docker images for running a PHP app mounted as a volume: mount the app, start the container, done.
Built for the CakePHP layout (document root /src/app/webroot), but works with any PHP app.
maidea/webserver, source: MAIDEA/webserverphp:<version>-apache-bookworm images (Debian 12)linux/amd64 only (runs through emulation on Apple Silicon)docker run --rm -p 8080:80 -v "$PWD/src:/src" maidea/webserver:prod-apache-php8.4
Serves ./src/app/webroot on http://localhost:8080. For other layouts set APACHE_DOCUMENT_ROOT (see Configuration below).
| Tags | PHP | Variant |
|---|---|---|
latest, prod-apache-php, prod-apache-php8, prod-apache-php8.4 | 8.4 | prod |
prod-apache-php8.3 | 8.3 | prod |
dev-apache-php, dev-apache-php8, dev-apache-php8.4 | 8.4 | dev |
dev-apache-php8.3 | 8.3 | dev |
Which tag to use:
prod-apache-php8.4, dev-apache-php8.3, … stay on that PHP version and only receive patch releases. Recommended.latest, prod-apache-php, prod-apache-php8, dev-apache-php, dev-apache-php8 move to the newest PHP version when one is added
(e.g. 8.5), which can break your app.<tag>-<php version>-<build date> (e.g. prod-apache-php8.4.27-20261022, .2 etc. for further builds that day)
are never overwritten: pin one for reproducible deploys or to roll back.The images are rebuilt automatically when the official PHP image changes (PHP patch releases, Debian security updates), usually within a day. Older PHP versions are listed under Legacy tags below.
| prod | dev | |
|---|---|---|
| Errors | logged to stderr (docker logs), not displayed | displayed and logged |
| OPcache | on, JIT on, no file timestamp checks (see below) | off |
| Xdebug | – | 3.x, trigger mode |
| Composer, git | – | yes |
| Upload / post size | 256M | 128M |
max_execution_time | 60 s | 180 s |
| Session cookie | secure (configurable), httponly, strict mode | not secure |
| Version headers | hidden (Server: Apache, no X-Powered-By) | shown |
prod: restart after code changes. OPcache does not check file timestamps, so code changed on the mounted volume is only picked up after a container restart.
/usr/local/bin/wkhtmltopdf.
It is no longer maintained upstream and uses an old browser engine: do not render untrusted HTML or URLs with it.mysql, mysqldump)mod_rewrite and mod_headers; .htaccess files are honoured, directory listing is offhealthy once Apache and PHP serve requests.
It uses an internal listener on 127.0.0.1:8081 that is not reachable from outside the container and does not touch your app.Development, with Docker Compose:
services:
app:
image: maidea/webserver:dev-apache-php8.4
volumes:
- "./src:/src"
ports:
- "8080:80"
# on Linux, Xdebug's default host.docker.internal needs:
#extra_hosts:
# - "host.docker.internal:host-gateway"
Production, behind a reverse proxy that terminates HTTPS:
services:
app:
image: maidea/webserver:prod-apache-php8.4
restart: unless-stopped
volumes:
- "./src:/src"
environment:
- PHP_MEMORY_LIMIT=512M
# with jwilder/nginx-proxy:
#- VIRTUAL_HOST=app.example.com
# with Traefik:
#labels:
# - "traefik.http.routers.app.rule=Host(`app.example.com`)"
expose:
- "80"
Good to know:
www-data (uid 33). Directories your app writes to (e.g. app/tmp) must be writable for that user.secure, so the app must be reached over HTTPS (or set SESSION_COOKIE_SECURE=0).APACHE_DOCUMENT_ROOT=/src/public.docker logs).All variables are read at container start.
| Variable | Default | Variant | Notes |
|---|---|---|---|
PHP_MEMORY_LIMIT | 1024M | both | PHP memory_limit |
SESSION_COOKIE_SECURE | 1 | prod | set to 0 only if the app is served over plain HTTP |
APACHE_DOCUMENT_ROOT | /src/app/webroot | both | |
XDEBUG_REMOTE_HOST | host.docker.internal | dev | where the IDE listens; works on Docker Desktop, on Linux see extra_hosts above |
XDEBUG_IDE_KEY | PHPSTORM | dev | trigger value: send XDEBUG_SESSION=PHPSTORM (browser extension, cookie or query parameter) |
XDEBUG_MODE | develop,debug | dev | e.g. debug,profile, or off |
XDEBUG_REMOTE_PORT | 9003 | dev | |
XDEBUG_OUTPUT_DIR | /tmp | dev | profiler/trace output |
XDEBUG_OUTPUT_PROFILE_NAME | cachegrind.out.%p | dev |
Legacy tags run PHP versions that are no longer supported by the PHP project and have known vulnerabilities. Use them only if you cannot upgrade yet, and never expose them to the internet.
| PHP | Tags |
|---|---|
| 7.4.33 | prod-apache-php7.4, prod-apache-php7, dev-apache-php7.4, dev-apache-php7 |
| 5.6.40 | dev-apache-php5.6, dev-apache-php5 |
These receive only backported fixes for critical vulnerabilities, no other updates. They contain the fix for CVE-2026-109618 / CVE-2026-109619 (PHP advisory): 7.4 with the PHP security team's backport, 5.6 with Ondřej Surý's backport of the same fix. Many other known 5.6 vulnerabilities remain unfixed.
Changed with the October 2026 rebuild (mitigations recommended by the advisory):
post_max_size 110M; Apache rejects larger request bodies)KeepAlive Off, MaxConnectionsPerChild 1): safer, but slower under loadmax_input_nesting_level is 16PHP_MEMORY_LIMIT=-1 removes the PHP memory limit and prevents the app from setting one, which blocks the out-of-memory path of CVE-2026-109618.
Only use it together with a container memory limit (e.g. mem_limit in Compose), otherwise one runaway request can use all memory of the server.| PHP | Tags |
|---|---|
| 8.2.10 | prod-apache-php8.2, dev-apache-php8.2 |
| 7.4 | dev-apache-php7-x3, dev-apache-php7-x3-pgsql |
| 7.0–7.3 | dev_apache_php7, dev-apache-php7.0, dev-apache-php7.2, dev-apache-php7-wpdf0.12.5, prod-apache-php7.3 |
| 5.6 | dev, dev1.4-apache-php5.6, dev1.6-apache-php5.6, dev1.7-apache-php5.6 |
| nginx + php-fpm (2017) | 1, 2 |
The 8.2 tags are vulnerable to the critical CVE-2026-109618 / CVE-2026-109619: move to prod-apache-php8.3 / dev-apache-php8.3.
Source and build instructions: github.com/MAIDEA/webserver (MAINTAINING.md).
These images are maintained for MAIDEA's own projects and offered to the public as-is, on a best-effort basis: there is no support, no guaranteed response to issues, and no warranty.
Copyright (c) 2026 MAIDEA. All rights reserved. The source is published for reference; see LICENSE. Third-party software in the images (Debian, PHP, Apache, wkhtmltopdf, …) is covered by its own licenses.
Content type
Image
Digest
sha256:4db01ee8a…
Size
255 MB
Last updated
1 day ago
docker pull maidea/webserver