question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't listen for Connection... PHP Xdebug Vagrant

See original GitHub issue

I have a LAMP stack setup on a vagrant machine that I want to debug using vdebug. I’ve setup xdebug and its working fine with other IDEs ( vscode, intellij ).

The debugger doesn’t really seem to even attempt to connect or listen for a connection. As soon as I press F5 to start the debugger, I get the following ( all at once, no 20 second timeout ):

Waiting for a connection (Ctrl-C to cancel, this message will self-destruct in 20 seconds…) Connection to the debugger has been closed Press ENTER or type command to continue

I’m willing to bet its my setup for VIM. I’ve tried outputting Vdebug log but nothing was generated when I ran the commands in the README. Any help is appreciated!

Here is :version output…

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 11 2017 08:58:57) MacOS X (unix) version Included patches: 1-1175 Compiled by Homebrew Huge version with MacVim GUI. Features included (+) or not (-): +acl +cindent +cryptv -ebcdic +float +insert_expand +lispindent +mouseshape +mouse_xterm +path_extra +quickfix +statusline +terminal +user_commands +wildmenu -xterm_clipboard +arabic +clientserver +cscope +emacs_tags +folding +job +listcmds +mouse_dec +multi_byte +perl +reltime -sun_workshop +terminfo +vertsplit +windows -xterm_save +autocmd +clipboard +cursorbind +eval -footer +jumplist +localmap -mouse_gpm +multi_lang +persistent_undo +rightleft +syntax +termresponse +virtualedit +writebackup +balloon_eval +cmdline_compl +cursorshape +ex_extra +fork() +keymap +lua -mouse_jsbterm -mzscheme +postscript +ruby +tag_binary +textobjects +visual -X11 +browse +cmdline_hist +dialog_con_gui +extra_search +fullscreen +lambda +menu +mouse_netterm +netbeans_intg +printer +scrollbind +tag_old_static +timers +visualextra -xfontset ++builtin_terms +cmdline_info +diff +farsi -gettext +langmap +mksession +mouse_sgr +num64 +profile +signs -tag_any_white +title +viminfo +xim +byte_offset +comments +digraphs +file_in_path -hangul_input +libcall +modify_fname -mouse_sysmouse +odbeditor +python +smartindent +tcl +toolbar +vreplace -xpm +channel +conceal +dnd +find_in_path +iconv +linebreak +mouse +mouse_urxvt +packages -python3 +startuptime +termguicolors +transparency +wildignore -xsmp system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "$VIM/gvimrc" user gvimrc file: "$HOME/.gvimrc" 2nd user gvimrc file: "~/.vim/gvimrc" defaults file: "$VIMRUNTIME/defaults.vim" system menu file: "$VIMRUNTIME/menu.vim" fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim" Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X_UNIX -F/usr/local/opt/python/Frameworks -I/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python /2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: clang -L. -L/usr/local/lib -L. -L/usr/local/lib -F/usr/local/opt/python/Frameworks -L/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -framework CoreFoundation -L/usr/local/lib -o Vim -framework Cocoa -framework Ca rbon -lm -lncurses -liconv -framework Cocoa -L/usr/local/opt/lua/lib -llua -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -F/usr/local/opt/python/Frameworks -framework Python -F/System/Library/Frameworks -framework Tcl -fram ework CoreFoundation -framework Ruby

Xdebug:

xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_host = 10.0.2.2
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 512

VIM config:

let g:vdebug_options = { 'path_maps': { '/home/vagrant/sites': '/Users/ethan/sites'}, 'server': '192.168.10.10' }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
BlackIkeEaglecommented, Feb 21, 2018

Closing this since it looks like the issue is resolved

1reaction
camilopayancommented, Dec 7, 2017

Of course! the second I ask, I understand the problem a little better. Put more debugging information into the plugin and found that the problem was configuring Homestead to forward the port, thus occupying the port on my host machine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xdebug is installed, but the IDE does not listen to it
I've to install xdebug on my Vagrant VM, it is also loaded when you start PHP and compiled with it. php --ini ......
Read more >
Breakpoints not working when performing remote debugging
I'm in the same boat; PHP running in vagrant. I can see xdebug connecting via the extension in vscode when I execute my...
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 to ......
Read more >
Vagrant + PHPStorm + Xdebug not connecting - Google Groups
I am trying to set up a Vagrant box for Xdebug so I can run some performance tests, however I am having no...
Read more >
PHP Xdebug + Netbeans + Vagrant
Click on the debug button in Netbeans or press Ctrl + F5 to start the Netbeans debugger and start listening on port 9000....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found