cannot connect to xdebug - `Connection to the debugger has been closed`
See original GitHub issueI’m trying to connect to xdebug on a remote VM, but it just fails instantly with “Connection to the debugger has been closed”. I created github repo with a Vagrant VM which reproduces this issue. Once up and running, the VM is reachable at 33.33.33.10 and has xdebug loaded (it appears in phpinfo output ). I have also checked that xdebug.ini is parsed.
Logging doesn’t help much:
- [Info] {Fri 19 2013 11:59:14} Connection to the debugger has been closed
Looking through the source code, it seems this message is shown when a socket is closed, but I don’t know where to go from here.
vdebug settings:
g:vdebug_options
{'debug_file': 'vdebug_log',
'debug_file_level': 2,
'watch_window_style': 'expanded',
'marker_default': '*',
'continuous_mode': 0,
'ide_key': '',
'break_on_open': 1,
'on_close': 'detach',
'path_maps': {'/var/www': 'C:\code\xdebug-test'},
'marker_closed_tree': '+',
'timeout': 20,
'port': 9000,
'marker_open_tree': '-',
'debug_window_level': 1,
'server': '33.33.33.10'}
Also, here’s some output from Apache’s access.log:
33.33.33.1 - - [19/Apr/2013:12:26:11 +0100] "GET /debug_me.php HTTP/1.1" 200 314 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0"
Issue Analytics
- State:
- Created 10 years ago
- Comments:41
Top Results From Across the Web
php - Xdebug unable to connect to client, where do I start ...
A solution that is possible in intranets and VPNs is to configure xdebug to connect to port 9000 of the local machine but,...
Read more >Troubleshooting common PHP debugging issues | PhpStorm ...
When the debugger cannot connect or refuses the connection, check the following: Make sure Xdebug or Zend Debugger are configured to connect ......
Read more >Documentation » Description of errors - Xdebug
Occurs when Xdebug is trying to connect to a debuging client to start a debugging session. The debugger could not make a connection...
Read more >failed to launch debug adapter cannot connect to runtime ...
While you wait for the fix, there are multiple reasons for this error to show up but the most probably is because the...
Read more >The Visual Studio Remote Debugger service on the target ...
This error means that the remote debugger service is running under a user account that cannot authenticate when it tries to connect to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Iazel you’re a lifesaver. My understanding of
remote_portwas the same as yours before. That totally makes sense now!Hello guys! I’m trying to use docker and this error popup. My current vdebug_options:
However in the log there’s no useful information, only this:
My Dockerfile configuration:
The xdebug.ini:
This is the relevant bit of the docker-compose.yml
Any ideas?
Solved
Ok, it seems I wasn’t understanding what
remote_portmeans. I thought it was the port where the debugger was listening to (likenode --debug), but It turns out is the other way around and it should be the port on the local machine, the one from which we initiate the debugging! Removing the port bind on 9001 has done the trick, and even more, using docker we can use the default 9000 port 😃Corret docker-compose.yml:
And the xdebug.ini can be shortened to