I'm using PhpStorm on Mac. I'm trying to debug a Laravel application inside the Sail container on the remote Ubuntu server.
Error that I can see from Xdebug inside Sail container is:
[17] Log opened at 2021-09-26 21:24:59.590599
[17] [Step Debug] INFO: Checking remote connect back address.
[17] [Step Debug] INFO: Checking header 'HTTP_X_FORWARDED_FOR'.
[17] [Step Debug] INFO: Client host discovered through HTTP header, connecting to 89.164.145.129:9003.
[17] [Step Debug] WARN: Could not connect to client host discovered through HTTP headers, connecting to configured address/port: host.docker.internal:9003. :-|
[17] [Step Debug] INFO: Connected to debugging client: XXX.XXX.XXX.XXX:9003 (from HTTP_X_FORWARDED_FOR HTTP header), host.docker.internal:9003 (fallback through xdebug.client_host/xdebug.client_port). :-)
[17] [Step Debug] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/html/server.php" language="PHP" xdebug:language_version="8.0.5" protocol_version="1.0" appid="17" idekey="phpstorm"><engine version="3.0.4"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2021 by Derick Rethans]]></copyright></init>
[17] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
[17] [Step Debug] WARN: 2021-09-26 21:24:59.896494: There was a problem sending 179 bytes on socket 10: Broken pipe.
[17] Log closed at 2021-09-26 21:24:59.898408
I've set up server, SSH tunnel, auto file deployment, Xdebug, and validated in PhpStorm, but I keep getting this error.
The issue is that PhpStorm is listening for debug connections, but retrieves none, debug is not triggered in the IDE.