试图让PHP XDebug使用Visual Studio代码

时间:2018-05-14 16:19:06

标签: php visual-studio-code xdebug

我按照教程:http://www.accella.net/knowledgebase/debugging-php-with-visual-studio-code/

xdebug已经附带了我的WAMP版本和我的PHP 5.6.31,所以我没有下载和安装它。我刚刚在Apache PHP.ini以及c:\ wamp \ bin \ php \ php5.6.31目录下的CLI PHP.ini文件中启用它,如下所示。

; XDEBUG Extension
[xdebug]
zend_extension ="c:/wamp/bin/php/php5.6.31/zend_ext/php_xdebug-2.5.5-5.6-vc11-x86_64.dll"
xdebug.remote_enable = on
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="c:/wamp/tmp"
xdebug.show_local_vars=0

我可以在我的代码中设置一个断点但是当我在浏览器中打开代码时,我没有休息 来自phpinfo:

xdebug support                          enabled
--------------------------------------- ----------------------------
Version                                 2.5.5
IDE Key                                 DESKTOP-L4O32PQ$

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.force_display_errors             Off                     Off
xdebug.force_error_reporting            0                       0
xdebug.halt_level                       0                       0
xdebug.idekey                           no value                no value
xdebug.max_nesting_level                256                     256
xdebug.max_stack_frames                 -1                      -1
xdebug.overload_var_dump                2                       2
xdebug.profiler_aggregate               Off                     Off
xdebug.profiler_append                  Off                     Off
xdebug.profiler_enable                  Off                     Off
xdebug.profiler_enable_trigger          Off                     Off
xdebug.profiler_enable_trigger_value    no value                no value
xdebug.profiler_output_dir              c:/wamp/tmp             c:/wamp/tmp
xdebug.profiler_output_name             cachegrind.out.%t.%p    cachegrind.out.%t.%p
xdebug.remote_addr_header               no value                no value
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                       no value                no value
xdebug.remote_mode                      req                     req
xdebug.remote_port                      9000                    9000
xdebug.scream                           Off                     Off
xdebug.show_error_trace                 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_enable_trigger_value       no value                no value
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

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

xdebug.remote_autostart                 On
xdebug.remote_connect_back              On

确保您的IDE正在侦听端口9000