Skip to content

AkibaWolf/docker-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP

akibawolf/php packages recent versions of PHP using Debian as the base image.

Supported tags and respective Dockerfile links

Base images used:

  • php-stretch for 7.0
  • php-buster for 7.1 and 7.2
  • php-bullseye for 7.3, 7.4, 8.0 and 8.1
  • php-bookworm for 8.2
  • php-trixie for 8.3 and newer

Pre-installed packages

  • curl
  • ffmpeg (for PHP >= 8.3.0)
  • git
  • ping
  • mc
  • mplayer (for PHP >= 8.3.0)
  • nano
  • supervisor
  • unzip
  • vim
  • wget

Pre-configured extensions

  • apcu (for PHP >= 8.2.0)
  • bcmath
  • gd
  • gearman
  • geoip (for PHP < 8.4.0)
  • imagick
  • intl
  • mbstring
  • mcrypt
  • memcached
  • mysqli
  • opcache (for PHP < 8.5.0)
  • pcntl (for PHP >= 8.2.0)
  • pdo_mysql
  • pdo_pgsql
  • redis
  • sockets (for PHP >= 8.2.0)
  • xdebug (for images with xdebug suffix)
  • xml (for PHP >= 8.2.0)
  • xsl (for PHP >= 8.2.0)
  • zip (for PHP >= 8.2.0)

Usage

CLI shell:

docker run --rm -it akibawolf/php:cli-latest bash

FPM:

docker run --rm -v /app:/app --env FPM_PORT=9001 --expose 9001 akibawolf/php:fpm-latest

Docker compose:

php:
  image: akibawolf/php:fpm-latest
  container_name: project-php
  working_dir: /app/project
  environment:
    FPM_PORT: 9001
  volumes:
    - ./web/project:/app/project
  networks:
    - default
  expose:
    - 9001

Docker compose with Xdebug:

php:
  image: akibawolf/php:8.4-xdebug-fpm
  container_name: project-php
  working_dir: /app/project
  environment:
    FPM_PORT: 9001
    PHP_IDE_CONFIG: serverName=yourdomain.com
  volumes:
    - ./web/project:/app/project
  extra_hosts:
    - host.docker.internal:host-gateway
  networks:
    - default
  expose:
    - 9001

Configuration defaults

Name Value
short_open_tag Off
implicit_flush Off
max_execution_time 30
max_input_time 60
memory_limit 128M
error_reporting E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors On
display_startup_errors Off
log_errors On
error_log /dev/stderr
post_max_size 140M
default_mimetype text/html
default_charset UTF-8
file_uploads On
upload_max_filesize 128M
max_file_uploads 20
date.timezone Asia/Tashkent

FPM environment variables

Name Default value
FPM_USER www-data
FPM_GROUP www-data
FPM_HOST 0.0.0.0
FPM_PORT 9000
PHP_MEMORY_LIMIT * 128M
PHP_POST_MAX_SIZE 140M
PHP_UPLOAD_MAX_FILESIZE 128M

* Available in images that provide PHP 7.1 and higher.

Xdebug environment variables

Name Default value
PHP_IDE_CONFIG serverName=localhost
XDEBUG_CLIENT_HOST host.docker.internal
XDEBUG_CLIENT_PORT 9003
XDEBUG_IDE_KEY PHPSTORM
XDEBUG_START_WITH_REQUEST yes

Available in FPM Xdebug images.

Configuration

You can also inject your version of configuration files as needed:

  • /usr/local/etc/php/php.ini
  • /usr/local/etc/php-fpm.conf
  • /usr/local/etc/php-fpm.d/www.conf
  • /etc/supervisor/conf.d/supervisord.conf
  • /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

About

Docker images of PHP based on Debian Linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published