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.

Another important setting is ‘xdebug.client_host’ which should be set to ‘host.docker.internal’ when working with Docker containers.

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

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