spocke / php-debugger

PHP Debugger for Brackets.
MIT License
40 stars 7 forks source link

Remote debugging #16

Open JustAGuyTryingToCodeSomething opened 9 years ago

JustAGuyTryingToCodeSomething commented 9 years ago

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?

isaacbacon1 commented 9 years ago

Same issue here. Developping on Win7 64-bit and using a ubuntu vagrant box as a webserver. PHP 5.6 / Apache 2.2.0 / Xdebug installed with remote debugging enabled.

d4mation commented 8 years ago

Issue still persists. I'd love to use this with my Vagrant box; but as it is, it can't tell it is there since it lives in a VM.