Sign inSign up

prooph/php

By prooph

•Updated about 3 years ago

Extends the official PHP image for development

Image
6

100K+

prooph/php repository overview

⁠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.1, 7.2, 7.3 and 7.4

There are also PHP ZTS versions.

⁠cli

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

⁠cli with Opcache

Use the following image: prooph/php:7.4-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.4-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.4-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.4-cli-xdebug php [your file]

⁠cli with SensioLabs Blackfire

Use the following image: prooph/php:7.4-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.4-cli-blackfire run php [your PHP script]

⁠fpm

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

⁠fpm with Opcache

Use the following image: prooph/php:7.4-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.4-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.4-fpm-blackfire.

SensioLabs Blackfire⁠ is a PHP Profiler.

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

Tag summary

Content type

Image

Digest

sha256:d80c87de0…

Size

303 MB

Last updated

about 3 years ago

docker pull prooph/php:8.2-zts-xdebug