Wordpress & xdebug3 for development purpose only
480
https://github.com/AndreaDiPietro-ADP/wordpress-docker-compose-xdebug3
This images ENTRYPOINTs writes XDEBUG_CONFIG env variable values
inside a configuration file (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini) at container startup,
before calling the original Apache ENTRYPOINT script docker-entrypoint.sh apache2-foreground.
So, you can pass all the settings as you write them on the configuration file, remember to not drop xdebug prefix of settings name.
environment:
XDEBUG_CONFIG: |
xdebug.mode=debug,develop
xdebug.client_host=host.docker.internal
xdebug.client_port=9003
xdebug.idekey="phpdebugkey"
host.docker.internal should work both on Windows and MacOS DockerDesktop, anyway it can be replaced with the internal IP address used by your host machine.
IDE setting is quite easy and straight-forward,
for example in NetBeans 12.3 put port 9003 and idekey phpdebugkey as stated inside the docker-compose.yml

If it still not works create a PHP file inside the container web directory with
xdebug_info();
to check if Xdebug configuration is set properly...
If that does not works, check whether a firewall is active and if it is silently dropping or refusing connection to the 9003 port or if the port is not free for Xdebug.
Content type
Image
Digest
Size
181.9 MB
Last updated
about 5 years ago
docker pull andreadipietro/wordpress