Sign inSign up

jamesmorrison/php

By jamesmorrison

•Updated 4 days ago

Ubuntu-based PHP runtime images

Image
Web servers
0

10K+

jamesmorrison/php repository overview

⁠PHP Docker Images

Ubuntu-based PHP runtime images for web applications and command-line tasks.

Image: jamesmorrison/php

⁠Versions and platforms

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>.

⁠Runtime defaults

SettingDefault
Base operating systemUbuntu 24.04
PHP version for local builds8.5
Container userwww-data - UID/GID 33
Working directory/var/www/html
Default processPHP-FPM in the foreground
FastCGI listener0.0.0.0:9000
Upload and POST size limits100M

The image provides PHP-FPM, not an HTTP server. Application files and writable directories must have permissions suitable for www-data.

⁠Extensions and tools

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

OPcache caches compiled PHP bytecode, not application results or database data.

SettingDefault
FPM cachingEnabled
CLI cachingDisabled
Timestamp validationEnabled
Timestamp revalidation interval0 - check on every request
OPcache memory128 MB
Interned strings buffer16 MB
Configured maximum cached files999999
Maximum wasted memory threshold10%

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.

⁠PHP-FPM

SettingValue
Process managementDynamic
Maximum workers50
Initial workers5
Minimum idle workers5
Maximum idle workers35
Requests before worker recycling500

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/.

⁠Mail and sessions

Environment variableDefault
MAILER_HOSTmailcatcher
MAILER_PORT1025
SESSION_HANDLERfiles
SESSION_PATH/var/lib/php/sessions

Mail is forwarded through msmtp using the /usr/sbin/sendmail compatibility link.

Session settings apply to FPM.

⁠Build arguments

ArgumentDefaultPurpose
PHP_VERSION8.5Selects the PHP version
PHP_UPLOAD_LIMIT100MSets upload_max_filesize and post_max_size

⁠Health check

Checks that a PHP-FPM process exists and TCP port 9000 accepts connections.

SettingValue
Interval30 seconds
Timeout10 seconds
Startup grace period40 seconds
Retries3

The check covers process/listener availability, not application health.

Tag summary

Content type

Image

Digest

sha256:a99a628d1…

Size

232.5 MB

Last updated

4 days ago

docker pull jamesmorrison/php:8.5