Sign inSign up

mobidevpublisher/php

By mobidevpublisher

•Updated 3 days ago

PHP image based on official Debian PHP-fpm image. Provided by MobiDev

Image
2

50K+

mobidevpublisher/php repository overview

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

⁠What's Inside?

  • Composer⁠
  • Configurable extensions list
  • Pre-installed list of php extensions:
    • amqp
    • apcu
    • gd
    • gmp
    • intl
    • ldap
    • mcrypt (removed from php 8.1)
    • memcached
    • mongodb
    • opcache
    • pdo
    • pdo_mysql
    • pdo_pgsql
    • redis
    • soap
    • sockets
    • sodium
    • xdebug
    • yaml
    • zip
    • bcmath (added since php 7.4.33, 8.0.26, 8.1.13)

⁠List of Enabled Extensions:

docker run --rm -it mobidevpublisher/php:latest php -m

⁠Environment variables

⁠PHP_INI_PRESET

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

⁠PHP_ENABLED_EXTENSIONS

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

⁠PHP_DISABLED_EXTENSIONS

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"
⁠PHP_ALLOW_URL_FOPEN

allow-url-fopen⁠ Runtime Configuration variable

Example value: On

⁠PHP_DISPLAY_ERRORS

display-errors⁠ Runtime Configuration variable

Example value: Off

⁠PHP_DISPLAY_STARTUP_ERRORS

display-startup-errors⁠ Runtime Configuration variable

Example value: "On"

⁠PHP_MAX_EXECUTION_TIME

max-execution-time⁠ Runtime Configuration variable

Example value: 30

⁠PHP_MAX_INPUT_TIME

max-input-time⁠ Runtime Configuration variable

Example value: 60

⁠PHP_MAX_INPUT_VARS

max-input-vars⁠ Runtime Configuration variable

Example value: 1000

⁠PHP_MEMORY_LIMIT

memory-limit⁠ Runtime Configuration variable

Example value: 128M

⁠PHP_POST_MAX_SIZE

post-max-size⁠ Runtime Configuration variable

Example value: 8M

⁠PHP_SHORT_OPEN_TAG

short-open-tag⁠ Runtime Configuration variable

Example value: On

⁠PHP_UPLOAD_MAX_FILESIZE

upload-max-filesize⁠ Runtime Configuration variable

Example value: 2M

⁠PM_MAX_CHILDREN

pm.max-children⁠ The number of child processes to be created

Example value: 5

⁠How to use this image

⁠PHP CLI in docker

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

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

⁠Your own Dockerfile

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

⁠Configuration

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

⁠Image Variants

mobidevpublisher/php:''''''

Examples:

docker pull mobidevpublisher/php:8.4

⁠License

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.

Tag summary

Content type

Image

Digest

sha256:125a43703…

Size

269.3 MB

Last updated

3 days ago

docker pull mobidevpublisher/php