1
votes

I'm using DDEV for drupal8-development. I have the same project on win10pro and on ubuntu18.04. On win10 I can debug in Phpstorm, on ubuntu it fails. I've already spent hours searching.

In the .ddev folder of the projects I sure did set the "xdebug_enabled" parameter to true. On the version on ubuntu I created additional configuration so that I receive logs from Xdebug. When ssh into the webserver container and I inspect the xdebug log at /var/log/xdebug.log it shows something like:

I: connecting to configured address/port: host.docker.internal:9000
E: Time-out connecting to client(waited: 200ms). :-(

from within the container I can ping host.docker.internal, the IP of host.docker.internal resolves to 172.17.0.1

When I inspect the logs from phpstorm on ubuntu it shows: 2018-08-16 13:47:39,141 [2778275] DEBUG - il.connection.ServerConnection - Starting 'Xdebug Server' on port 9000

Nothing seems to solve the problem. I already did export my phpstorm-settings from win10(where debugging does work) and import them in phpstorm on ubuntu and it still fails.

in phpstorm I do not receive any popup showing "new incoming connection from xdebug" Xdebug did work in the past, but never when using ddev. In ddev it's using 2.6.0 and the xdebug part of phpinfo() shows on ubuntu and win10 the same output. xdebug installed xdebug settings

help much appreciated. Geert

1
did you export the port 9000? (what does docker ps says?) - Edwin
Please try the debugging techniques in stackoverflow.com/questions/49677199/… - rfay
The usual problem is a firewall on the host blocking port 9000. - rfay

1 Answers

3
votes

It wasn't a DDEV-problem, it was indeed the firewall causing the issue. I created a rule for ufw:

 sudo ufw allow in on docker0 from 172.17.0.0/24 to 172.17.0.1/32 port 9000 comment xdebug

and a rule for iptables:

sudo iptables -I INPUT -p tcp -m tcp --dport 9000 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 9000 -j ACCEPT

@rfay ,thanks for the hint.