Skip to content

trouble connecting to xdebug in docker #249

@makeshift3ds

Description

@makeshift3ds

PHP version: 7.2
XDebug version: 2.6.0
Adapter version: 1.12.1

Example Repo: https://github.com/makeshift3ds/vscode-xdebug-docker

Hello, I am having trouble getting vscode to connect to xdebug running in docker. I've followed examples and tutorials but feel like something is missing.

Notes:

  • if I start the debugger in vscode, the debugger output says 'success: true' in the object. But the xdebug logs in the docker container show no activity. However, if I run the php script from the php-fpm container xdebug logs look healthy.
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to 172.18.0.1:9001.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/html/index.php" language="PHP" xdebug:language_version="7.2.3" protocol_version="1.0" appid="7" idekey="VSCODE"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>

Log closed at 2018-03-13 15:29:11
  • if I attempt a connection in vscode and try to evaluate some code it says there is no connection.

  • php-fpm is running on port 9000 so I setup xdebug on 9001. I can see the ports are open.
    image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions