XDebug refuses to work with Docker after the 2017.3 update

Hello, after I updated to 2017.3 (from 2017.1 I believe), phpstorm refuses to connect to xdebug. I've followed all the tutorials here to set it up again from scratch, to no avail. When I try to run a phpunit test with debugging, the test passes and I get ""Connection with Xdebug 2.5.5 was not established. Validate installation." When I press Validate Installation, it passes, and it says to check configuration (which I haven't changed and I know is good.) The php.ini contains all the proper config.

https://gyazo.com/268cfeca8748ce825da332c6e857068d

The config, which has always worked for me:

zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
xdebug.cli_color=1
xdebug.remote_connect_back=1
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.ide_key=PHPSTOR

The phpstorm settings are set to listen to the default port 9000.

The one strange thing I'm noticing is that in the PHP interpreter dialog, if I press the "show phpinfo" button, the xdebug.remote_log value is always blank, even if I add it to the ini xdebug configuration file that's being loaded (according to the show phpinfo page). I don't know what to make of this. Thus I can't view xdebug logs. If I run phpinfo() from within the docker container, it does shows the correct setting and the chosen log file.

Any ideas?

6 comments

I'm experiencing the same issue after updating to PhpStorm-2017.3.2. Downgrading to PhpStorm-2017.2.4 restores xdebug functionality, so it's definitely an issue introduced in the latest PhpStorm.

0

Hi Aaron, unfortunately downgrading doesn't resolve the issue for me so I am stuck without a debugger :(

0

Unfortunately, we do really need to take a look at the Xdebug remote log.

even if I add it to the ini xdebug configuration file that's being loaded (according to the show phpinfo page)

What if you change other parameters in there, do they have effect (comparing to remote_log)?

0

Hi Eugene, I didn't try what you said yet, but the solution to the problem can be found in the comments here, to add an additional configuration option: https://youtrack.jetbrains.com/issue/WI-38060

This is a docker for mac specific issue.

0

I have the same issue now even when I set up my php.ini with 

xdebug.remote_host=docker.for.mac.localhost

or

xdebug.remote_host=docker.for.mac.host.internal

(which worked for me two weeks ago) I get the same error as described above.

The only solution is to go to the Preferences -> Languages & Frameworks -> PHP -> CLI Interpreter -> Configuration options
and add a new configuration directive "xdebug.remote_host" with value "docker.for.mac.localhost". And this solved my problem. 

0

Please sign in to leave a comment.