Sign inSign up

jamesmorrison/php-dev

By jamesmorrison

•Updated 4 days ago

Ubuntu based PHP development image extending "jamesmorrison/php"

Image
Web servers
0

10K+

jamesmorrison/php-dev repository overview

⁠PHP Development Docker Images

PHP development images extending jamesmorrison/php with debugging tools, Node.js and command-line utilities.

Image: jamesmorrison/php-dev

These images are intended for development, not production. All users have passwordless sudo access.

⁠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-dev:<version>. Test tags use <version>-test-<commit-sha>.

Each version builds on the matching jamesmorrison/php:<version> image.

⁠Runtime defaults

SettingDefault
Base operating systemUbuntu 24.04, inherited from the PHP image
PHP version for local builds8.5
Container userwww-data - UID/GID 33
User home directory/home/www-data
Working directory/var/www/html
Default startup script/entrypoint-dev.sh
Default processPHP-FPM in the foreground
FastCGI listener0.0.0.0:9000
Upload and POST size limits100M, inherited from the default PHP image

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

⁠Extensions and tools

The image inherits PHP extensions, Composer, WP-CLI, ImageMagick, mail support and other runtime tools from the PHP image⁠.

Development additions include:

  • Xdebug
  • Git and Subversion
  • MariaDB client
  • Nano and Vim
  • strace
  • iproute2 and telnet
  • sudo with passwordless access for all users
  • nvm 0.40.1 and the Node.js LTS release selected at build time

nvm and Node.js are installed under the www-data home directory. nvm is shell-based; its environment must be loaded when needed in non-interactive shells.

⁠Xdebug

Xdebug is installed, but the default startup script disables it unless ENABLE_XDEBUG=true.

Environment variableDefaultPurpose
ENABLE_XDEBUGfalseControls Xdebug loading for CLI and FPM at startup

The value is case-insensitive. Only true enables Xdebug.

Enabling Xdebug loads the extension; debugging modes, client connection settings and triggers require separate Xdebug configuration.

Commands that bypass /entrypoint-dev.sh also bypass its Xdebug enable/disable handling.

⁠OPcache

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

SettingDefault
FPM cachingEnabled
CLI cachingDisabled
Timestamp validationExplicitly enabled
Timestamp revalidation interval0 - check on every request, inherited from the PHP image
OPcache memory128 MB
Interned strings buffer16 MB

The development image appends opcache.validate_timestamps=1 to the inherited configuration. It does not change the revalidation interval.

PHP 8.2-8.4 use a separate OPcache package and module. PHP 8.5 includes OPcache in the PHP binary. The development override works with both arrangements.

Shared configuration: /etc/php/<version>/mods-available/docker-opcache.ini.

⁠PHP-FPM

FPM configuration is inherited from the PHP image.

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

The development startup script delegates to the PHP image startup script for mail and session configuration.

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 base image version and matching Xdebug package
BASE_IMAGEjamesmorrison/phpSelects the base image repository

Upload limits and other base-image settings are inherited. PHP_UPLOAD_LIMIT is configured when building the PHP base image, not this development image.

⁠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. It expects the container to be running PHP-FPM rather than a standalone CLI command.

Tag summary

Content type

Image

Digest

sha256:6e297b911…

Size

418.8 MB

Last updated

4 days ago

docker pull jamesmorrison/php-dev:8.4