PHP image based on official Debian PHP-fpm image. Provided by MobiDev
50K+
Extended Docker PHP-FPM image based on Official PHP Docker Image
PHP-FPM is a FastCGI implementation for PHP. See the PHP-FPM.org website for more information about PHP-FPM.
Maintained by: MobiDev
Supported architectures: linux/amd64, linux/arm64
docker run --rm -it mobidevpublisher/php:latest php -m
Includes list of enabled modules depending on value set
Available values: production, development. Default: production
Note: use one of the PHP_ENABLED_EXTENSIONS or PHP_INI_PRESET environment variable
Set list of enabled extensions
Example value: "apcu gd gmp intl mcrypt opcache pdo pdo_mysql pdo_pgsql redis sodium"
Note: use one of the PHP_ENABLED_EXTENSIONS or PHP_INI_PRESET environment variable
Set list of disabled extensions
Example value: "xdebug"
You can use combination of PHP_INI_PRESET and PHP_DISABLED_EXTENSIONS. PHP_INI_PRESET sets the list of enabled extensions. PHP_DISABLED_EXTENSIONS disable some extensions from the list
For example:
PHP_INI_PRESET: "development"
PHP_DISABLED_EXTENSIONS: "xdebug redis pdo_mysql"
allow-url-fopen Runtime Configuration variable
Example value: On
display-errors Runtime Configuration variable
Example value: Off
display-startup-errors Runtime Configuration variable
Example value: "On"
max-execution-time Runtime Configuration variable
Example value: 30
max-input-time Runtime Configuration variable
Example value: 60
max-input-vars Runtime Configuration variable
Example value: 1000
memory-limit Runtime Configuration variable
Example value: 128M
post-max-size Runtime Configuration variable
Example value: 8M
short-open-tag Runtime Configuration variable
Example value: On
upload-max-filesize Runtime Configuration variable
Example value: 2M
pm.max-children The number of child processes to be created
Example value: 5
check php version
docker run -it mobidevpublisher/php:latest php -v
show information about all PHP environment
docker run -it mobidevpublisher/php:latest php -i
Docker Compose file example for Development environment
version: '3.5'
services:
php:
image: mobidevpublisher/php:8.4
restart: always
working_dir: /var/www/html
environment:
PHP_INI_PRESET: "development"
PHP_ALLOW_URL_FOPEN: "On"
PHP_MAX_EXECUTION_TIME: 60
PHP_MAX_INPUT_TIME: 60
PHP_MEMORY_LIMIT: "128M"
PHP_POST_MAX_SIZE: "120M"
PHP_UPLOAD_MAX_FILESIZE: "100M"
PHP_SHORT_OPEN_TAG: "On"
PHP_DISPLAY_ERRORS: "On"
PHP_DISPLAY_STARTUP_ERRORS: "On"
volumes:
- ".:/var/www/html"
networks:
- local
Docker Compose file example for Production environment
version: '3.5'
services:
php:
image: mobidevpublisher/php:8.4
restart: always
working_dir: /var/www/html
environment:
PHP_ENABLED_EXTENSIONS: "amqp apcu sodium redis zip pdo_pgsql gd gmp"
PHP_ALLOW_URL_FOPEN: "On"
PHP_MAX_EXECUTION_TIME: 60
PHP_MAX_INPUT_TIME: 60
PHP_MEMORY_LIMIT: "128M"
PHP_POST_MAX_SIZE: "120M"
PHP_UPLOAD_MAX_FILESIZE: "100M"
PHP_SHORT_OPEN_TAG: "On"
PHP_DISPLAY_ERRORS: "Off"
PHP_DISPLAY_STARTUP_ERRORS: "Off"
volumes:
- ".:/var/www/html"
networks:
- local
Create a Dockerfile in your PHP project
FROM mobidevpublisher/php:8.4
COPY . /var/www/html
WORKDIR /var/www/html
CMD [ "php-fpm" ]
Then, run the commands to build and run the Docker image:
docker build -t my-php-app .
docker run -it --rm --name my-running-app my-php-app
This image ships with the default php.ini-development and php.ini-production configuration files.
Use PHP_INI_PRESET environment variable to set development or production config
mobidevpublisher/php:''''''
Examples:
docker pull mobidevpublisher/php:8.4
The MIT License
Copyright (c) 2009-2025 MobiDev Corporation [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Content type
Image
Digest
sha256:125a43703…
Size
269.3 MB
Last updated
3 days ago
docker pull mobidevpublisher/php