Sign inSign up

ciroarcadio/php

By ciroarcadio

Updated almost 2 years ago

General Purpose PHP image (with xDebug and Xhprof)

Image
3

4.3K

ciroarcadio/php repository overview

Quick reference

Refer to official PHP image documentation.


Out of the box utilities:

  • composer (1&2)
  • xdebug
  • xhprof module
  • crontab
Env configuration

Use env variables to configure multiple scenarios as follows.

Enable xdebug
REMOTE_HOST_IP="{your host ip}"
APP_DEBUG=true

You can use default config or override/extend it with your own. eg with default config:

docker run -e APP_DEBUG=true -e REMOTE_HOST_IP=192.168.0.100 ciroarcadio/php php examplescript.php

then listen to remote connections with passphrase PHPSTORM

Enable profiler (xhprof)
PROFILER_ENABLED=true

Once enabled, use of edyan/xhgui image is recommended.

Disable one or more PHP modules
#bcmath calendar gd gmp intl lzf mcrypt mongo[php <= 5.6]/mongodb[php >= 7] mysqli pdo_mysql soap sodium xsl zip
PHP_DISABLE_EXT="memcache memcached mongodb"
Switch to composer 2
COMPOSER_DEFAULT_VERSION=2

Or manually call on of

composer1 -v
composer2 -v
Running Cron jobs

Crontab is enabled and containerd by default, so feel fre to use it at your convenience.

docker-compose eg:

services:
  app:
    image: ciroarcadio/php:7.3-fpm
    working_dir: /var/www/html
    environment:
      COMPOSER_ALLOW_SUPERUSER: 1
      COMPOSER_HOME: /root/composer
      COMPOSER_PROCESS_TIMEOUT: 2000
      WEB_ROOT: /var/www/html
      APP_PUBLIC: /public
    volumes:
      [...]
      ## Cron
      - cronvolume:/var/spool/cron/
      [...]
  volumes:
    - cronvolume:

Happy Coding!

Tag summary

Content type

Image

Digest

sha256:cf7c5614a

Size

155.8 MB

Last updated

almost 2 years ago

docker pull ciroarcadio/php:8.3-fpm-alpine