在 Apache 2 Debian 11 上启用 Xdebug

Enable Xdebug on Apache 2 Debian 11

我需要在 Apache 2 网络服务器上调试 PHP 应用程序 运行。 但是 Xdebug 根本不会做任何事情;正如我在 phpinfo().

中看到的那样,配置已正确加载
zend_extension=xdebug.so

[debug]
xdebug.profiler_enable_trigger = 0
xdebug.profiler_enable = 1
#xdebug.remote_enable = 1
xdebug.profiler_output_dir = "/tmp"
#xdebug.client_host = ip-of-my-desktop
#xdebug.log = "/tmp/xdebug.log"
#xdebug.default_enable = 1
#xdebug.discover_client_host = 1
xdebug.log_level = 10
xdebug.log =  "debug"
xdebug.output_dir = /tmp

我尝试了很多组合,但没有任何效果。

感谢您的帮助,我 运行 没有办法让它在 Debian 9 机器上运行。

来自 phpinfo()

的 xdebug 部分
Development Aids    ✔ enabled   
Coverage    ✘ disabled  
GC Stats    ✘ disabled  
Profiler    ✘ disabled  
Step Debugger   ✘ disabled  
Tracing ✘ disabled  
Directive   Local Value Master Value
xdebug.auto_trace   (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.cli_color    0   0
xdebug.client_discovery_header  no value    no value
xdebug.client_host  localhost   localhost
xdebug.client_port  9003    9003
xdebug.cloud_id no value    no value
xdebug.collect_assignments  Off Off
xdebug.collect_includes (setting removed in Xdebug 3)   (setting removed in Xdebug 3)
xdebug.collect_params   (setting removed in Xdebug 3)   (setting removed in Xdebug 3)
xdebug.collect_return   Off Off
xdebug.collect_vars (setting removed in Xdebug 3)   (setting removed in Xdebug 3)
xdebug.connect_timeout_ms   200 200
xdebug.coverage_enable  (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.default_enable   (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.discover_client_host Off Off
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.file_link_format no value    no value
xdebug.filename_format  no value    no value
xdebug.force_display_errors Off Off
xdebug.force_error_reporting    0   0
xdebug.gc_stats_enable  (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.gc_stats_output_dir  (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.gc_stats_output_name gcstats.%p  gcstats.%p
xdebug.halt_level   0   0
xdebug.idekey   no value    no value
xdebug.log  debug   debug
xdebug.log_level    10  10
xdebug.max_nesting_level    256 256
xdebug.max_stack_frames -1  -1
xdebug.mode develop develop
xdebug.output_dir   /tmp    /tmp
xdebug.overload_var_dump    (setting removed in Xdebug 3)   (setting removed in Xdebug 3)
xdebug.profiler_append  Off Off
xdebug.profiler_enable  (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.profiler_enable_trigger  (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.profiler_enable_trigger_value    (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.profiler_output_dir  (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.profiler_output_name cachegrind.out.%p   cachegrind.out.%p
xdebug.remote_autostart (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.remote_connect_back  (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.remote_enable    (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.remote_host  (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.remote_log   (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.remote_log_level (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.remote_mode  (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.remote_port  (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.remote_timeout   (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
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   (setting removed in Xdebug 3)   (setting removed in Xdebug 3)
xdebug.start_upon_error default default
xdebug.start_with_request   default default
xdebug.trace_enable_trigger (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.trace_enable_trigger_value   (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.trace_format 0   0
xdebug.trace_options    0   0
xdebug.trace_output_dir (setting renamed in Xdebug 3)   (setting renamed in Xdebug 3)
xdebug.trace_output_name    trace.%c    trace.%c
xdebug.trigger_value    no value    no value
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth    3   3

PS: 我安装了包 php-xdebug
PPS: Xdebug v3.0.2

我不确定为什么它现在起作用了。

现在我有了这个配置。

xdebug.mode="debug"
xdebug.trigger_value="XDEBUG_ECLIPSE"
xdebug.start_with_request="yes"
xdebug.client_host="myip"

Cookie 和环境变量没有任何改变。