Aaron Lamb
Aaron Lamb

Reputation: 115

Cannot connect to Xdebug with Netbeans or DBGp Debugger.vim

I know this has been asked countless, as I've scoured the forums and read so many of these posts. However, it appears that the failures here are based on so many variables that the solutions are rather particular to the problem, and nothing is really remedying my problem here. I feel I need some guidance from you all more experienced players.


WHAT'S HAPPENING:

In NetBeans:

In Vim:


WHAT I'VE GOT:

xdebug

xdebug support => enabled
Version => 2.2.5
IDE Key => aaron  
Supported protocols => Revision
DBGp - Common DeBuGger Protocol => $Revision: 1.145 $  
Directive => Local Value => Master Value
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.coverage_enable => On => On
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.file_link_format => no value => no value
xdebug.idekey => no value => no value
xdebug.max_nesting_level => 100 => 100
xdebug.overload_var_dump => On => On
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => Off => Off
xdebug.profiler_output_dir => /tmp => /tmp
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.remote_autostart => Off => Off
xdebug.remote_connect_back => Off => Off
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_log => /var/log/apache2/xdebug.log => /var/log/apache2/xdebug.log
xdebug.remote_mode => rep => rep
xdebug.remote_port => 9001 => 9001
xdebug.scream => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_enable_trigger => Off => Off
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /tmp => /tmp
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3

Any help is greatly appreciated!! Thank you in advance.

Upvotes: 0

Views: 1309

Answers (1)

moskito-x
moskito-x

Reputation: 11968

You did not set your xdebug.idekey => no value

xdebug.idekey => no value => no value

also

xdebug.remote_autostart => Off => O

is wrong.

Set it to

; idekey can be just about anything, but the value in php.ini needs
; to match the value used in the environment that launches php. 
xdebug.idekey=vim_session

and

; We have to turn on remote_autostart when running php from
; cli.  That's probably a good reason to keep the cli and apache
; versions of php.ini distinct.
xdebug.remote_autostart=1

You should see a message like waiting for a new connection on port 9000 for 5 seconds… at the bottom of the screen.

You have five seconds to now refresh the PHP page.

This will create a connection between the debugger and client. Now you’re debugging. Follow the instructions in the Help window to step into, over and out of code. Press F5 to run the code until a breakpoint (which you can set using : BP )

also look at this answer PHP debugger for Vim

Update

Let phpinfo run again and see if the values ​​I have mentioned are correct now? Then look also what other php config files still in use and look at the content.

Getting the server to connect on a different port is a little trickier. You need to set a custom php.ini value (xdebug.remote_port) for each user. It works best if you’re using VirtualHost’s in Apache. Just add the following line to the VirtualHost section of your httpd.conf:

php_value xdebug.remote_port 9001

Now restart Apache and if you use that VirtualHost and that vi user, then they should connect successfully.

Upvotes: 0

Related Questions