Update (1 November 2026): This article documents a PHP 8.0 / Xdebug 3 development setup from 2020. PHP 8.0 reached end of life on 26 November 2023. For new environments, choose a currently supported PHP branch.

PHP 8.0 is now released, as well as official PHP docker images which you can use as a base for creating (development) environments to suit your needs.

With the release of PHP 8, the must-have development tool Xdebug version 3 is also released, which brings many great new features, but also a change in configuration options.

Dockerfile

Here is the Dockerfile I use to create a Debian container with PHP 8:

https://github.com/cicnavi/dockers/blob/master/dap/80/Dockerfile

Xdebug 3 configuration

Since Xdebug version 3, there are different config options used to start up the debug process. Main difference is to use option ‘xdebug.mode‘ to set the way in which the Xdebug will run, ‘xdebug.discover_client_host’ to set how will Xdebug find about the client host to connect to, and the new default port which is now 9003.

With Docker Desktop, xdebug.client_host can use host.docker.internal to reach the host. On native Docker Engine for Linux, configure that name explicitly using Docker’s host-gateway mapping.

Full settings that I use are listed in .ini file:

https://github.com/cicnavi/dockers/blob/master/dap/80/php-config/custom.ini