Sign inSign up

adeliom/php

By adeliom

•Updated 10 days ago

Image
Developer tools
Web servers
0

10K+

adeliom/php repository overview

⁠Adeliom PHP

Docker Pulls

This repository contains a set of developer-friendly, general purpose PHP images for Docker.

  • You can also modify the php.ini settings using environment variables.
  • 2 runtime variants available: cli, fpm
  • 4 server variants available: apache, nginx, caddy and frankenphp
  • A variant with wkhtmltopdf
  • Images come with Composer

⁠⚠️ Important

This project is maintained by ❤️ by @agence-adeliom⁠. And images are used for our projects and clients. This work is open-source and publicly available, but we do not provide any guarantee or official support. Use at your own risk and always test thoroughly before deploying to production.

⁠Latest Images

NamePHP versionvariantserverwkhtmltopdf
adeliom/php:8.1-cli8.1cli
adeliom/php:8.2-cli8.2cli
adeliom/php:8.3-cli8.3cli
adeliom/php:8.4-cli8.4cli
adeliom/php:8.1-cli-wkhtmltopdf8.1cli✅
adeliom/php:8.2-cli-wkhtmltopdf8.2cli✅
adeliom/php:8.3-cli-wkhtmltopdf8.3cli✅
adeliom/php:8.4-cli-wkhtmltopdf8.4cli✅
adeliom/php:8.1-fpm8.1fpm
adeliom/php:8.2-fpm8.2fpm
adeliom/php:8.3-fpm8.3fpm
adeliom/php:8.4-fpm8.4fpm
adeliom/php:8.1-fpm-wkhtmltopdf8.1fpm✅
adeliom/php:8.2-fpm-wkhtmltopdf8.2fpm✅
adeliom/php:8.3-fpm-wkhtmltopdf8.3fpm✅
adeliom/php:8.4-fpm-wkhtmltopdf8.4fpm✅
adeliom/php:8.1-apache8.1fpmapache
adeliom/php:8.2-apache8.2fpmapache
adeliom/php:8.3-apache8.3fpmapache
adeliom/php:8.4-apache8.4fpmapache
adeliom/php:8.1-apache-wkhtmltopdf8.1fpmapache✅
adeliom/php:8.2-apache-wkhtmltopdf8.2fpmapache✅
adeliom/php:8.3-apache-wkhtmltopdf8.3fpmapache✅
adeliom/php:8.4-apache-wkhtmltopdf8.4fpmapache✅
adeliom/php:8.1-nginx8.1fpmnginx
adeliom/php:8.2-nginx8.2fpmnginx
adeliom/php:8.3-nginx8.3fpmnginx
adeliom/php:8.4-nginx8.4fpmnginx
adeliom/php:8.1-nginx-wkhtmltopdf8.1fpmnginx✅
adeliom/php:8.2-nginx-wkhtmltopdf8.2fpmnginx✅
adeliom/php:8.3-nginx-wkhtmltopdf8.3fpmnginx✅
adeliom/php:8.4-nginx-wkhtmltopdf8.4fpmnginx✅
adeliom/php:8.1-caddy8.1fpmcaddy
adeliom/php:8.2-caddy8.2fpmcaddy
adeliom/php:8.3-caddy8.3fpmcaddy
adeliom/php:8.4-caddy8.4fpmcaddy
adeliom/php:8.1-caddy-wkhtmltopdf8.1fpmcaddy✅
adeliom/php:8.2-caddy-wkhtmltopdf8.2fpmcaddy✅
adeliom/php:8.3-caddy-wkhtmltopdf8.3fpmcaddy✅
adeliom/php:8.4-caddy-wkhtmltopdf8.4fpmcaddy✅
adeliom/php:8.2-frankenphp8.2phpfrankenphp
adeliom/php:8.3-frankenphp8.3phpfrankenphp
adeliom/php:8.4-frankenphp8.4phpfrankenphp
adeliom/php:8.5-frankenphp8.5phpfrankenphp
adeliom/php:8.2-frankenphp-wkhtmltopdf8.2phpfrankenphp✅
adeliom/php:8.3-frankenphp-wkhtmltopdf8.3phpfrankenphp✅
adeliom/php:8.4-frankenphp-wkhtmltopdf8.4phpfrankenphp✅
adeliom/php:8.5-frankenphp-wkhtmltopdf8.5phpfrankenphp✅

⁠Specific Images versions

Using latest tags is a good way to stay up to date, but sometimes you need more control over the version you are using :

All detailed images are the latest stable versions. You can also use specific versions by adding a -{specific-version} part in the image name by one of the following: Example: adeliom/php:8.4-caddy-dev or adeliom/php:8.4-caddy-1.0.0

  • On every release, the image tag is moved to the new version.
  • On every release a new tag is created with the version number (e.g. 1.0.0, 1.0.1, etc.). See releases list⁠
  • Before a new release, the dev tag is used for the new version. Do not use this tag in production.

To stay up to date, you can use the default tag, which is always pointing to the latest stable version. build_php.yml⁠ And if you have some trouble with the latest stable version, you can use a adeliom/php:8.4-caddy-{specific-version} tag, which is always pointing to the previous released version. See releases list⁠

⁠Usage

These images are based on the official PHP image⁠.

Example with CLI:

$ docker run -it --rm --name my-running-script -v "$PWD":/var/www/html adeliom/php:8.2-cli-latest php your-script.php

Example with Apache:

$ docker run -p 80:80 --rm --name my-apache-php-app -v "$PWD":/var/www/html adeliom/php:8.2-apache-latest

Example with PHP-FPM:

$ docker run -p 9000:9000 --rm --name my-php-fpm -v "$PWD":/var/www/html adeliom/php:8.2-fpm-latest

⁠Default working directory

The working directory (the directory in which you should mount/copy your application) depends on the image variant you are using:

VariantWorking directory
cli/var/www/html
fpm/var/www/html
apache/var/www/html
nginx/var/www/html
caddy/var/www/html
frankenphp/var/www/html

⁠Changing server document root

For all server variants, you can change the document root (i.e. your "public" directory) by using the DOCUMENT_ROOT variable:

# The root of your website is in the "public" directory:
DOCUMENT_ROOT=/var/www/html/public/

⁠Setting parameters in php.ini

PHP.ini variableEnvironement variable nameDefault value
memory_limitPHP_INI_MEMORY_LIMIT128M (fpm) -1 (cli)
date.timezonePHP_INI_DATE_TIMEZONEUTC
cgi.fix_pathinfoPHP_INI_CGI_FIX_PATHINFO1
upload_max_filesizePHP_INI_UPLOAD_MAX_FILESIZE16M
post_max_sizePHP_INI_POST_MAX_SIZE16M
error_reportingPHP_INI_ERROR_REPORTINGE_ALL & ~E_DEPRECATED & ~E_STRICT
display_errorsPHP_INI_DISPLAY_ERRORSOff
display_startup_errorsPHP_INI_DISPLAY_STARTUP_ERRORSOff
realpath_cache_sizePHP_INI_REALPATH_CACHE_SIZE4096k
realpath_cache_ttlPHP_INI_REALPATH_CACHE_TTL120
opcache.memory_consumptionPHP_INI_OPCACHE_MEMORY_CONSUMPTION128
opcache.interned_strings_bufferPHP_INI_OPCACHE_INTERNED_STRINGS_BUFFER8
opcache.max_accelerated_filesPHP_INI_OPCACHE_MAX_ACCELERATED_FILES4000
opcache.revalidate_freqPHP_INI_OPCACHE_REVALIDATE_FREQ60
opcache.validate_timestampsPHP_INI_OPCACHE_VALIDATE_TIMESTAMPS1
opcache.fast_shutdownPHP_INI_OPCACHE_FAST_SHUTDOWN1
opcache.enable_cliPHP_INI_OPCACHE_ENABLE_CLI1
opcache.enablePHP_INI_OPCACHE_ENABLE1
opcache.preloadPHP_INI_OPCACHE_PRELOAD``
opcache.preload_userPHP_INI_OPCACHE_PRELOAD_USER``
soap.wsdl_cache_enabledPHP_INI_SOAP_WSDL_CACHE_ENABLED1
max_execution_timePHP_INI_MAX_EXECUTION_TIME30
max_input_timePHP_INI_MAX_INPUT_TIME60
sendmail_pathPHP_INI_SENDMAIL_PATHsendmail -t -i

⁠Debugging

To enable XDebug you simply have to set the environment variable:

XDEBUG_MODE='debug'
XDEBUG_CONFIG='client_host=host.docker.internal discover_client_host=1 log=/tmp/xdebug.log remote_enable=true remote_host=host.docker.internal'

You can setup your own xdebug config by following the documentation of Xdebug⁠

⁠Extensions available

These extensions are enabled by default in images : amqp ctype curl date dom exif fileinfo filter ftp gd gettext hash iconv imagick intl json ldap libxml mbstring mongodb mysqli mysqlnd openssl pcre PDO pdo_mysql pdo_pgsql pdo_sqlite pgsql Phar posix readline redis Reflection session SimpleXML soap sodium SPL sqlite3 standard swoole sysvsem tokenizer xdebug xml xmlreader xmlwriter opcache zip zlib

This list can be outdated, you can verify by executing : docker run --rm -it adeliom/php:8.1-cli php -m

⁠Compiling extensions in the custom image with mlocati/docker-php-extension-installer⁠
FROM ${REGISTRY}/php:8.1-apache

# Install tidy extension
RUN install-php-extensions tidy

Made with ❤️ by @agence-adeliom⁠

Tag summary

Content type

Image

Digest

sha256:160e7f5d8…

Size

171 MB

Last updated

10 days ago

docker pull adeliom/php:8.4-caddy-wkhtmltopdf-v1.4.0