PHP Docker Container Images

May 25, 2026 · View on GitHub

Build Status Docker Pulls Docker Stars

Table of Contents

Docker Images

❗For better reliability we release images with stability tags (wodby/php:8-X.X.X) which correspond to git tags. We strongly recommend using images only with stability tags.

About images:

Supported tags and respective Dockerfile links:

-dev

Images with -dev tag have a few differences:

  • sudo allowed for all commands for wodby user
  • PHP source code available under /usr/src/php.tar.xz
  • PHP_FPM_CLEAR_ENV is set to no by default
  • Additional packages installed: tig, tmux, yarn and npm

-dev-macos

Same as -dev but the default user/group wodby has uid/gid 501/20 to match the macOS default user/group ids.

Supported architectures

All images built for linux/amd64 and linux/arm64

Environment Variables

PHP and PHP-FPM configuration

The default configuration is not recommended for use for production environment:

Variable8.58.48.38.2
PHP_ALLOW_URL_FOPENOnOnOnOn
PHP_APCU_ENABLE_CLI0000
PHP_APCU_ENABLED1111
PHP_APCU_ENTRIES_HINT4096409640964096
PHP_APCU_COREDUMP_UNMAP0000
PHP_APCU_GC_TTL3600360036003600
PHP_APCU_PRELOAD_PATHNULLNULLNULLNULL
PHP_APCU_SERIALIZER
PHP_APCU_SHM_SEGMENTS1111
PHP_APCU_SHM_SIZE128M128M128M128M
PHP_APCU_SLAM_DEFENSE1111
PHP_APCU_TTL0000
PHP_APCU_USE_REQUEST_TIME1111
PHP_ASSERT_ACTIVE---On
PHP_AUTO_PREPEND_FILE
PHP_AUTO_APPEND_FILE
PHP_BROTLI_OUTPUT_COMPRESSION0000
PHP_BROTLI_OUTPUT_COMPRESSION_LEVEL-1-1-1-1
PHP_CLI_MEMORY_LIMIT-1-1-1-1
PHP_DATE_TIMEZONEUTCUTCUTCUTC
PHP_DEFAULT_SOCKET_TIMEOUT60606060
PHP_DISABLE_FUNCTIONS
PHP_DISABLE_CLASSES
PHP_DISPLAY_STARTUP_ERRORSOnOnOnOn
PHP_ERROR_REPORTINGE_ALLE_ALLE_ALLE_ALL
PHP_EXPOSEOffOffOffOff
PHP_EXTENSIONS_DISABLExdebug,xhprof,spxxdebug,xhprof,spxxdebug,xhprof,spxxdebug,xhprof,spx
PHP_FPM_CLEAR_ENVyesyesyesyes
PHP_FPM_ENV_VARS
PHP_FPM_LOG_LEVELnoticenoticenoticenotice
PHP_FPM_PMdynamicdynamicdynamicdynamic
PHP_FPM_PM_MAX_CHILDREN8888
PHP_FPM_PM_MAX_REQUESTS500500500500
PHP_FPM_PM_MAX_SPARE_SERVERS3333
PHP_FPM_PM_MIN_SPARE_SERVERS1111
PHP_FPM_PM_STATUS_PATH
PHP_FPM_REQUEST_SLOWLOG_TIMEOUT
PHP_FPM_PM_START_SERVERS2222
PHP_FPM_USERwww-datawww-datawww-datawww-data
PHP_FPM_GROUPwww-datawww-datawww-datawww-data
PHP_GRPC_ENABLE_FORK_SUPPORT1111
PHP_GRPC_LOG_FILENAME/proc/self/fd/2/proc/self/fd/2/proc/self/fd/2/proc/self/fd/2
PHP_GRPC_POLL_STRATEGYepoll1epoll1epoll1epoll1
PHP_GRPC_TRACE
PHP_GRPC_VERBOSITYerrorerrorerrorerror
PHP_IGBINARY_COMPACT_STRINGSOnOnOnOn
PHP_LOG_ERRORSOnOnOnOn
PHP_LOG_ERRORS_MAX_LEN0000
PHP_MAX_EXECUTION_TIME120120120120
PHP_MAX_FILE_UPLOADS20202020
PHP_MAX_INPUT_TIME60606060
PHP_MAX_INPUT_VARS2000200020002000
PHP_MEMORY_LIMIT512M512M512M512M
PHP_MYSQLI_CACHE_SIZE2000200020002000
PHP_NEWRELIC_LICENSE
see all newrelic ext options8.x newrelic8.x newrelic8.x newrelic8.x newrelic
PHP_OPCACHE_ENABLE1111
PHP_OPCACHE_ENABLE_CLI0000
PHP_OPCACHE_VALIDATE_TIMESTAMPS1111
PHP_OPCACHE_REVALIDATE_FREQ2222
PHP_OPCACHE_MAX_ACCELERATED_FILES4000400040004000
PHP_OPCACHE_MEMORY_CONSUMPTION128128128128
PHP_OPCACHE_INTERNED_STRINGS_BUFFER8888
PHP_OPCACHE_FAST_SHUTDOWN----
PHP_OPCACHE_HUGE_CODE_PAGES0000
PHP_OPCACHE_PRELOAD----
PHP_OPCACHE_PRELOAD_USERwww-datawww-datawww-datawww-data
PHP_OPCACHE_JITtracingtracingtracingtracing
PHP_OPCACHE_JIT_BUFFER_SIZE0000
PHP_OUTPUT_BUFFERING4096409640964096
PHP_PCOV_ENABLED0000
see all pcov ext options8.x pcov8.x pcov8.x pcov8.x pcov
PHP_PDO_MYSQL_CACHE_SIZE----
PHP_PHAR_READONLY1111
PHP_PHAR_REQUIRE_HASH1111
PHP_PHAR_CACHE_LIST
PHP_POST_MAX_SIZE32M32M32M32M
PHP_REALPATH_CACHE_SIZE4096k4096k4096k4096k
PHP_REALPATH_CACHE_TTL120120120120
PHP_SENDMAIL_PATH/usr/bin/msmtp -t -i/usr/bin/msmtp -t -i/usr/bin/msmtp -t -i/usr/bin/msmtp -t -i
PHP_MAIL_MIXED_LF_AND_CRLFOffOffOffOff
PHP_SESSION_SAVE_HANDLERfilesfilesfilesfiles
PHP_SHORT_OPEN_TAG1111
PHP_SPX_DATA_DIR/mnt/files/spx/mnt/files/spx/mnt/files/spx/mnt/files/spx
PHP_SPX_HTTP_ENABLED0000
PHP_SPX_HTTP_KEY
PHP_SPX_HTTP_IP_WHITELIST
see all sqlsrv ext options8.x sqlsrv8.x sqlsrv8.x sqlsrv8.x sqlsrv
see all session options8.3 session8.3 session8.3 session8.2 session
see all xhprof options8.x xhprof8.x xhprof8.x xhprof8.x xhprof
PHP_UPLOAD_MAX_FILESIZE32M32M32M32M
PHP_XDEBUG_MODEoffoffoffoff
see all xdebug ext options8.x xdebug8.x xdebug8.x xdebug8.x xdebug
PHP_ZEND_ASSERTIONS1111
PHP_ZEND_EXCEPTION_IGNORE_ARGS0000
PHP_ZEND_MULTIBYTE0000
PHP_ZEND_SIGNAL_CHECK0000
PHP_ZEND_EXCEPTION_STRING_PARAM_MAX_LEN15151515
PHP_ZEND_SCRIPT_ENCODING
PHP_ZEND_DETECT_UNICODE

"-" - Not available for this version

PHP_FPM_ENV_VARS must be a JSON array encoded as a string when used with PHP_FPM_CLEAR_ENV=yes, for example ["DB_USER","DB_NAME"]. In Docker Compose, quote it so YAML treats it as a string instead of an array:

services:
  php:
    environment:
      PHP_FPM_CLEAR_ENV: "yes"
      PHP_FPM_ENV_VARS: '["DB_USER","DB_NAME"]'

List-style Compose syntax also works:

services:
  php:
    environment:
      - PHP_FPM_CLEAR_ENV=yes
      - PHP_FPM_ENV_VARS=["DB_USER","DB_NAME"]

In a .env file use:

PHP_FPM_ENV_VARS=["DB_USER","DB_NAME"]

Additional configuration

VariableDefault value
GIT_USER_EMAILwodby@example.com
GIT_USER_NAMEwodby
HTTP_PROXY
SSH_PRIVATE_KEY
SSH_DISABLE_STRICT_KEY_CHECKING
SSHD_GATEWAY_PORTSno
SSHD_HOST_KEYS_DIR/etc/ssh
SSHD_LOG_LEVELINFO
SSHD_PASSWORD_AUTHENTICATIONno
SSHD_PERMIT_USER_ENVyes
SSHD_USE_DNSyes
MSMTP_PORT25
MSMTP_TLSoff
MSMTP_LOG
MSMTP_LOGFILE/proc/self/fd/2
MSMTP_AUTHoff
MSMTP_HOSTopensmtpd
MSMTP_ADD_MISSING_DATE_HEADERon
MARIADB_CLIENT_SSL_VERIFY_SERVER_CERT`

Build arguments

ArgumentDefault value
PHP_VER
PHP_DEV
WODBY_GROUP_ID1000
WODBY_USER_ID1000

Change WODBY_USER_ID and WODBY_GROUP_ID mainly for local dev version of images, if it matches with existing system user/group ids, the latter will be deleted.

PHP Extensions

Extensions xdebug, xhprof and spx disabled by default, to change it, override the default env var PHP_EXTENSIONS_DISABLE=xdebug,xhprof,spx.

Extension8.58.48.38.2
amqp2.2.02.2.02.2.02.2.0
apcu5.1.285.1.285.1.285.1.28
ast1.1.31.1.31.1.31.1.3
bcmath
brotli0.18.30.18.30.18.30.18.3
bz2
calendar
Core
ctype
curl
date
dom
ds2.0.02.0.02.0.02.0.0
exif
event3.1.43.1.43.1.43.1.4
fileinfo
filter
ftp
gd
grpc1.80.01.80.01.80.01.80.0
hash
iconv
igbinary3.2.17RC13.2.17RC13.2.17RC13.2.17RC1
imagick3.8.13.8.13.8.13.8.1
imap1.0.31.0.3--
imap--
intl
json
ldap
libxml
mbstring
memcached3.4.03.4.03.4.03.4.0
mongodb2.3.32.3.32.3.32.3.3
mysqli
mysqlnd
newreliclatestlatestlatestlatest
OAuth2.0.102.0.102.0.102.0.10
openssl
opentelemetry1.2.11.2.11.2.11.2.1
pcov1.0.121.0.121.0.121.0.12
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pdo_sqlsrv5.13.15.13.15.13.15.12.0
pgsql
Phar
posix
protobuf5.35.05.35.05.35.05.35.0
rdkafka6.0.56.0.56.0.56.0.5
readline
redis6.3.06.3.06.3.06.3.0
Reflection
session
SimpleXML
smbclient1.1.21.1.21.1.21.1.2
soap
sockets
sodium
SPL
spx0.4.220.4.220.4.220.4.22
sqlite3
sqlsrv5.13.15.13.15.13.15.12.0
standard
tidy
tokenizer
uploadprogress2.0.22.0.22.0.22.0.2
uuid1.3.01.3.01.3.01.3.0
xdebug3.5.13.5.13.5.13.5.1
xhprof2.3.102.3.102.3.102.3.10
xml
xmlreader
xmlwriter
xsl
yaml2.3.02.3.02.3.02.3.0
Zend OPcache
zip
zlib

Legend:

  • [EMPTY] – Core PHP extension
  • "-" - Not exists in this version > Some extensions may not be available in -dev images

Tools

Toolall PHP versions
Composerlatest

Xdebug

By default, xdebug mode set to off, which has close to 0 overhead. If you want to disable the extension completely set PHP_EXTENSIONS_DISABLE=xdebug.

Changelog

Changes per stability tag reflected in git tags description under releases.

Crond

You can run Crond with this image changing the command to sudo -E crond -f -d 0 and mounting a crontab file to ./crontab:/etc/crontabs/www-data. Example crontab file contents:

# min	hour	day	month	weekday	command
*/1	*	*	*	*	echo "test" > /mnt/files/cron

SSHD

You can run SSHD with this image by changing the command to sudo /usr/sbin/sshd -De and mounting authorized public keys to /home/wodby/.ssh/authorized_keys

Adding SSH key

You can add a private SSH key to the container by mounting it to /home/wodby/.ssh/id_rsa

Users and permissions

Default container user is wodby:wodby (UID/GID 1000). PHP-FPM runs from www-data:www-data user (UID/GID 82) by default. User wodby is a part of www-data group.

Codebase volume $APP_ROOT (/var/www/html) owned by wodby:wodby. Files volume $FILES_DIR (/mnt/files) owned by www-data:www-data with 775 mode.

See https://github.com/wodby/php/issues/22 for more details.

Helper scripts

  • files_chmod – in case you need write access for wodby user to a file/dir generated by www-data on this volume run sudo files_chmod [FILEPATH] script (FILEPATH must be under /mnt/files), it will recursively change the mode to ug=rwX,o=rX

  • files_chown – in case you manually uploaded files under wodby user to files volume and want to change the ownership of those files to www-data run sudo files_chown [FILEPATH] script (FILEPATH must be under /mnt/files), it will recursively change ownership to www-data:www-data

Complete PHP-based stacks

Images based on wodby/php

Orchestration Actions

Usage:

make COMMAND [params ...]

commands:
    migrate
    check-ready [host max_try wait_seconds delay_seconds]
    git-clone url [branch]
    git-checkout target [is_hash]   
    files-import source
    files-link public_dir 
    update-keys
    walter

default params values:
    is_hash 0
    branch "" Branch, tag or hash commit