Switch branches/tags
Nothing to show
Find file History
Permalink
..
Failed to load latest commit information.
config Add protobuf extension Sep 6, 2018
inc Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
m4 Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.0-cli Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.0-cli-blackfire Some housekeeping and PHP extension version updates Jul 24, 2018
7.0-cli-opcache Some housekeeping and PHP extension version updates Jul 24, 2018
7.0-cli-xdebug Some housekeeping and PHP extension version updates Jul 24, 2018
7.0-fpm Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.0-fpm-blackfire Some housekeeping and PHP extension version updates Jul 24, 2018
7.0-fpm-opcache Some housekeeping and PHP extension version updates Jul 24, 2018
7.0-fpm-xdebug Some housekeeping and PHP extension version updates Jul 24, 2018
7.0-zts Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.1-cli Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.1-cli-blackfire Some housekeeping and PHP extension version updates Jul 24, 2018
7.1-cli-opcache Some housekeeping and PHP extension version updates Jul 24, 2018
7.1-cli-xdebug Some housekeeping and PHP extension version updates Jul 24, 2018
7.1-fpm Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.1-fpm-blackfire Some housekeeping and PHP extension version updates Jul 24, 2018
7.1-fpm-opcache Some housekeeping and PHP extension version updates Jul 24, 2018
7.1-fpm-xdebug Some housekeeping and PHP extension version updates Jul 24, 2018
7.1-zts Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.2-cli Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.2-cli-blackfire Some housekeeping and PHP extension version updates Jul 24, 2018
7.2-cli-opcache Some housekeeping and PHP extension version updates Jul 24, 2018
7.2-cli-xdebug Some housekeeping and PHP extension version updates Jul 24, 2018
7.2-fpm Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.2-fpm-blackfire Some housekeeping and PHP extension version updates Jul 24, 2018
7.2-fpm-opcache Some housekeeping and PHP extension version updates Jul 24, 2018
7.2-fpm-xdebug Some housekeeping and PHP extension version updates Jul 24, 2018
7.2-zts Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.3-cli Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.3-cli-blackfire Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.3-cli-opcache Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.3-cli-xdebug Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.3-fpm Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.3-fpm-blackfire Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.3-fpm-opcache Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.3-fpm-xdebug Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
7.3-zts Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
README.md Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018
makefile Add PHP 7.3 and use Alpine 3.8 Nov 1, 2018

README.md

PHP Docker files with Alpine Linux

These images are only for development environments

These images are available on Docker Hub. Extends the official PHP image with the following PHP extensions:

  • intl
  • mysqli
  • pdo_mysql
  • pdo_pgsql
  • bcmath
  • mbstring
  • mongodb
  • pcntl
  • amqp
  • redis
  • soap
  • protobuf
  • swoole (cli only)

See prooph/proophessor-do app for an example.

Each image has tags for 7.0, 7.1, 7.2 and 7.3

There are also PHP ZTS versions.

cli

Use the following image: prooph/php:7.2-cli.

cli with Opcache

Use the following image: prooph/php:7.2-cli-opcache.

The PHP Opcache is not useful for development, so it's not part of the default PHP-FPM image. Use this image if you want to have Opcache enabled.

cli with Xdebug

Use the following image: prooph/php:7.2-cli-xdebug.

Xdebug is a PHP debugger.

xDebug is already enabled, so you have only to listen for incoming connections in your IDE. Don't forget to set the path mapping in your IDE with the name application !

Run the following command with the path to your php file.

$ docker run --rm -it --volume $(pwd):/app -e PHP_IDE_CONFIG="serverName=application" prooph/php:7.2-cli-xdebug php [your file]

Mac users doesn't have docker0 network. According to networking features they should change hostname.

$ docker run --rm -it --volume $(pwd):/app -e PHP_IDE_CONFIG="serverName=application" -e XDEBUG_HOST="docker.for.mac.localhost" prooph/php:7.2-cli-xdebug php [your file]

cli with SensioLabs Blackfire

Use the following image: prooph/php:7.2-cli-blackfire.

Blackfire is a PHP Profiler. No linking with Blackfire-Agent required.

Run the following command with your Blackfire credentials to profile you cli PHP apps.

$ docker run --rm -it -e BLACKFIRE_SERVER_ID=[YOUR ID] -e BLACKFIRE_SERVER_TOKEN=[YOUR TOKEN] -e BLACKFIRE_CLIENT_ID=[YOUR ID] -e BLACKFIRE_CLIENT_TOKEN=[YOUR TOKEN] --volume $(pwd):/app prooph/php:7.2-cli-blackfire run php [your PHP script]

fpm

Use the following image: prooph/php:7.2-fpm.

fpm with Opcache

Use the following image: prooph/php:7.2-fpm-opcache.

The PHP Opcache is not useful for development, so it's not part of the default PHP-FPM image. Use this image if you want to have Opcache enabled.

fpm with Xdebug

Use the following image: prooph/php:7.2-fpm-xdebug.

Xdebug is a PHP debugger.

Configure the Xdebug port in your IDE with 10000 and set the path mappings for the project root folder on server to /var/www. The server name is localhost. Don't forget to set the Xdebug cookie in your browser to start debugging.

fpm with Blackfire

Use the following image: prooph/php:7.2-fpm-blackfire.

SensioLabs Blackfire is a PHP Profiler.

Please refer to the docsto analyze your application. You need the Blackfire Agent Docker image.