DEV Community

Discussion on: Using Xdebug with Docker

Collapse
 
sergeytelpuk profile image
Sergey

I see that you put xdebug config direct in dockerfile it's bad approach. You can create a file
called xdebug.ini it can look like the following:

[Xdebug]
xdebug.remote_autostart=0
xdebug.remote_enable=1
xdebug.default_enable=0
xdebug.remote_host=host.docker.internal
xdebug.remote_port=9000
xdebug.remote_connect_back=0
xdebug.profiler_enable=0
xdebug.remote_log="/tmp/xdebug.log"
xdebug.profiler_output_dir="/var/www/html/profiler"
xdebug.profiler_output_name="cachegrind.out.%p"
xdebug.cli_color=1
xdebug.profiler_append=1

after that copy that one into /usr/local/etc/php/conf.d/

Collapse
 
joppedc profile image
JoppeDC

This is a lot cleaner, also since we use prebuilt docker images we cant just change the dockerfile. I've not been able to get it to work the way you explained, but i'll try again later ;)

Collapse
 
_mertsimsek profile image
Mert Simsek

Thank you for reply, it's prettier solution as you said.