xdebug connects successfully but does not work

My issue is similar to this older post:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/207064055-Zero-Config-Debug-not-working-but-everything-connects-

I am using a docker CLI interpreter to execute my phpunit tests, and until PHPStorm 2019.2 I was able to debug my tests successfully. I'm using the videoblocks/docker-php:7.3 image, which has barebones PHP 7.3.5 and Xdebug 2.7.2 without any custom configurations (just pecl installs).

Xdebug seems to be operating correctly when I check xdebug.log:

[1] Log opened at 2019-09-18 14:29:01
[1] I: Connecting to configured address/port: host.docker.internal:9000.
[1] I: Connected to client. :-)
[1] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///opt/project/vendor/phpunit/phpunit/phpunit" language="PHP" xdebug:language_version="7.3.5" protocol_version="1.0" appid="1" idekey="19469"><engine version="2.7.2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2019 by Derick Rethans]]></copyright></init>
[1]
[1] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
[1]
[1] Log closed at 2019-09-18 14:29:04
[1]

PHPStorm, however, gives me this message:

10:28 Connection was not established.: Probably 'xdebug.remote_host=host.docker.internal' is incorrect. Change 'xdebug.remote_host'

I believe I have all of the default configurations set for PHP Debugging in the IDE (port 9000, etc.), but I just get nothing.

Any ideas?

0

Would it be possible to share the logs? Please run Help > **Compress Logs and Show in ...** and upload resulting archive somewhere we could get it.

0
Avatar
Permanently deleted user

Yes. I opened a fresh PHPStorm, ran a debug test, and dumped the logs. They should be publicly viewable here: https://drive.google.com/open?id=18YsVPYCY3eKjhC8KTaWZUxqBd5Le3T3G

0

@Chas

Xdebug connects to some service .. and that's not PhpStorm. And that service knows how to respond to Xdebug...

The most obvious candidate is php-fpm.

1. Check that php-fpm is not running on your Mac

2. Check what service might be listening on TCP 9000 port (e.g. sudo lsof -nP -iTCP -sTCP:LISTEN). AFAIK IDE is unable to detect already used port on Mac (does correctly that on Windows and Linux).

3. Use another port. E.g. 9001 -- change it in php.ini and in IDE.

4. You may have screw up your Docker config (e.g. exposed TCP 9000 port for no reason).

2
Avatar
Permanently deleted user

@Andriy that did it! I forgot that our engineering team recently made some changes to our main codebase which starts php-fpm (I never used to have it running), and it didn't occur to me that it could be intercepting the xdebug connection.

I set the remote_debug port to 9001 and it works perfectly.

Thank you so much!

0

请先登录再写评论。