Can't make Xdebug work with Eclipse PDT

772 views Asked by At

I have Eclipse PDT and Xdebug installed with XAMPP . Although there are various solutions on the web but i couldn't find a solution for my problem .

Here is the phpinfo() from my XAMPP which shows that xdebug is installed :

xdebug

xdebug support  enabled
Version 2.2.6
IDE Key XDEBUG_ECLIPSE

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  \   \
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:8756  localhost:8756
xdebug.remote_log   no value    no value
xdebug.remote_mode  req req
xdebug.remote_port  9000    9000
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 \   \
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

Eclipse PDT when ran in debug mode pauses at 57% with eclipse showing "Launching : waiting for Xdebug Session" following is the URL that gets generated

127.0.0.1:8756/Mywebsite/index.html?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=14170721856664

I have followed various websites but all efforts went in vain .

Here's the php.ini part for Xdebug :

zend_extension = D:\xampp\php\ext\php_xdebug-2.2.6-5.5-vc11.dll
;xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "D:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = "localhost:8756"
xdebug.trace_output_dir = "D:\xampp\tmp"
;xdebug.remote_connect_back=1
xdebug.remote_port=9000

Note : Since the default apache port 8080 is occupied i have configured my apache to 8756

Waiting for the XDebug Session 57% in Eclipse PDT also couldn't help !

Thanks in Advance !!

2

There are 2 answers

4
zulus On

You have invalid configuration. Replace current xdebug.remote_host with host only. Port is not allowed here.

BTW: You enabled profiling by default. This may slowdown each request ;)

0
Mike Dole On

After several hours struggling trough posts I finally had my OMG it works experience with the following lines in php.ini:

zend_extension = "d:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll"
zend_extension_ts="d:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll"
zend_debugger.allow_hosts=127.0.0.1/32,192.168.2.3/32
xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.remote_connect_back=1
xdebug.remote_port=9100

Note d:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll has to be replaced with your path / dll. I've changed my port in php.ini. Make sure you use the same port in Eclipse (Debug Configurations --> Debugger --> Configure --> Debug Port --> 9100)

Regards,

Mike