Ubuntu-based PHP runtime images
10K+
Ubuntu-based PHP runtime images for web applications and command-line tasks.
Image: jamesmorrison/php
PHP versions: 8.2, 8.3, 8.4 and 8.5.
Platforms: linux/amd64 and linux/arm64.
Version tags follow the format jamesmorrison/php:<version> and track the installed patch release at build time. Test tags use <version>-test-<commit-sha>.
| Setting | Default |
|---|---|
| Base operating system | Ubuntu 24.04 |
| PHP version for local builds | 8.5 |
| Container user | www-data - UID/GID 33 |
| Working directory | /var/www/html |
| Default process | PHP-FPM in the foreground |
| FastCGI listener | 0.0.0.0:9000 |
| Upload and POST size limits | 100M |
The image provides PHP-FPM, not an HTTP server. Application files and writable directories must have permissions suitable for www-data.
PHP extensions include BCMath, cURL, GD, Imagick, Intl, Mbstring, Memcache, Memcached, MySQL, OPcache, Redis, SOAP, XML, XML-RPC and ZIP.
Tools include PHP CLI, Composer, WP-CLI, ImageMagick, msmtp, cURL, rsync, wget and unzip.
Xdebug and development tooling are not included.
Datadog PHP tracing/profiling installation is best-effort and depends on compatibility with the selected PHP version. Runtime activation is opt-in.
OPcache caches compiled PHP bytecode, not application results or database data.
| Setting | Default |
|---|---|
| FPM caching | Enabled |
| CLI caching | Disabled |
| Timestamp validation | Enabled |
| Timestamp revalidation interval | 0 - check on every request |
| OPcache memory | 128 MB |
| Interned strings buffer | 16 MB |
| Configured maximum cached files | 999999 |
| Maximum wasted memory threshold | 10% |
FPM benefits from bytecode caching while checking file timestamps on every request. CLI bytecode caching requires explicit activation.
PHP 8.2-8.4 use a separate OPcache package and module. PHP 8.5 includes OPcache in the PHP binary.
Shared configuration: /etc/php/<version>/mods-available/docker-opcache.ini.
| Setting | Value |
|---|---|
| Process management | Dynamic |
| Maximum workers | 50 |
| Initial workers | 5 |
| Minimum idle workers | 5 |
| Maximum idle workers | 35 |
| Requests before worker recycling | 500 |
FPM error logs go to stderr, and worker output capture is enabled. Environment variables are available to FPM workers.
Pool configuration: /etc/php-fpm.d/.
| Environment variable | Default |
|---|---|
MAILER_HOST | mailcatcher |
MAILER_PORT | 1025 |
SESSION_HANDLER | files |
SESSION_PATH | /var/lib/php/sessions |
Mail is forwarded through msmtp using the /usr/sbin/sendmail compatibility link.
Session settings apply to FPM.
| Argument | Default | Purpose |
|---|---|---|
PHP_VERSION | 8.5 | Selects the PHP version |
PHP_UPLOAD_LIMIT | 100M | Sets upload_max_filesize and post_max_size |
Checks that a PHP-FPM process exists and TCP port 9000 accepts connections.
| Setting | Value |
|---|---|
| Interval | 30 seconds |
| Timeout | 10 seconds |
| Startup grace period | 40 seconds |
| Retries | 3 |
The check covers process/listener availability, not application health.
Content type
Image
Digest
sha256:a99a628d1…
Size
232.5 MB
Last updated
4 days ago
docker pull jamesmorrison/php:8.5