PHP FPM/CLI with support for PostgreSQL, MySQL & some common extensions
10K+
PHP images based on the official image with support for PostgreSQL, MySQL, some common extensions & configurable via environment variables.
These are all available tags divided into six variants.
The following extra PHP extensions are installed.
You may install more extensions following the same method used with the official PHP image.
Configuration via environment variables is supported.
Environment variables prefixed with PHP. are set as PHP configurations.
Environment variables prefixed with PHP_FPM. are set as configuration for the www pool (fpm and Caddy variants only). For example:
docker run --rm -it \
-e PHP.memory_limit=256M \
-e PHP.post_max_size=64M \
-e PHP.upload_max_file_size=64M \
viblo/php
docker run --rm -it \
-e PHP.memory_limit=256M \
-e PHP_FPM.pm=ondemand \
-e PHP_FPM.pm.max_children=40 \
viblo/php:fpm
Or you can use the original method as used with the official image.
Healthcheck for php-fpm image is included as a script php-fpm-healthcheck.
docker run --rm -d \
--health-cmd=php-fpm-healthcheck \
--health-interval=15s \
--health-timeout=3s \
--health-retries=3 \
viblo/php:fpm
Using docker-compose:
healthcheck:
test: ["CMD", "php-fpm-healthcheck"]
interval: 15s
timeout: 3s
retries: 3
There are 3 variants (PHP CLI, PHP-FPM, Caddy) based on Alpine and Debian Stretch to fit your specific use cases.
Default base is Alpine for minimal image size. You can use the Debian variant if you need support for glibc dependent packages/extensions.
Docker tags follow the pattern viblo/php:<version>-<variant>-<base>.
<variant> is either cli, fpm, or caddy.
<base> is either alpine or stretch (current Debian suite).
Omiting <version> or <base> will make them the default values (PHP 7.3 on Alpine).
The Caddy variant contains the Caddy HTTP server to serve the application with php-fpm. Refer to the Caddy image for detailed usage.
Content type
Image
Digest
Size
32.2 MB
Last updated
almost 7 years ago
docker pull viblo/php