Skip to content

Remote debugging #16

Description

I thought this worked a while back when I first tried it, but when I came back and tried it again recently I couldn't get a connection between Xdebug and php-debugger, so maybe a fooled myself and debugged the local machine by mistake!

I'm developing using using Windows 10. I probably tried it on Windows 8 or a Mac first time round. The remote is a Debian Linux box. The remote is configured to run XDebug remotely.

I've tested using the windows debugclient-0.9.0.exe client, and that could make a connection, so running the same commands (DBGP) and looking at the code installed with the plugin I've come to the following conclusions:

  1. /node/xdebug l75 server.listen(args[0], 'localhost'); is limiting connections to the localhost, meaning only local debugging is permitted. Changing this to server.listen(args[0]); enables php-debugger to connect to the remote unit.
  2. The file-names on breakpoints aren't matching the remote unit. I'm unsure how this is supposed to work but the dev machine is trying to match (break on) C:\home\http\phptest.php whilst the remote unit is /home/http/phptest.php. Clearly using the same operating system on both units would help here! Changing /lib/xdebug line 107 from f: breakPoint.fullPath to f: breakPoint.fullPath.slice(3).replace('','/'), resolves this issue and allows me to debug remote files.

Is remote debugging supposed to work? If so how - and why do I need to make these changes? If not can it be added as a future enhancement?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions