Xdebug 3 配置文件

问题描述

我需要有关调试 Xdebug 3 配置的工作步骤的帮助。我在 Ubuntu 服务器 20.04 上使用 Nginx 运行 Xdebug 3.0.1,安装在 Oracle VirtualBox 上。我的 IDE 是 PHPStorm。

一切正常(SSH 隧道、SFTP、端口转发),连接已建立,但未开始分步调试。

我当前的 Xdebug 3 配置:

zend_extension=xdebug.so
xdebug.mode = debug
xdebug.client_host = 127.0.0.1
xdebug.client_port = 9003
XDEBUG_SESSION=PHPSTORM
xdebug.start_with_request=yes

有人在调试配置的工作步骤中配置了 Xdebug 3 并且可以帮助我吗??

PHPinfo() 从浏览器捕获的 Xdebug 部分 - 很长

调试 3.0.1版本

Feature Enabled/disabled    Docs
Development Aids    ✘ disabled  ?
Coverage    ✘ disabled  ?
GC Stats    ✘ disabled  ?
Profiler    ✘ disabled  ?
Step Debugger   ✔ enabled   ?
Tracing ✘ disabled  ?
Debugger    enabled
IDE Key no value
Directive   Local Value Master Value
xdebug.auto_trace   This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.auto_trace" This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.auto_trace"
xdebug.cli_color    0   0
xdebug.client_discovery_header  no value    no value
xdebug.client_host  127.0.0.1   127.0.0.1
xdebug.client_port  9003    9003
xdebug.cloud_id no value    no value
xdebug.collect_assignments  Off Off
xdebug.collect_includes This setting has been removed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#removed-"xdebug.collect_includes"   This setting has been removed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#removed-"xdebug.collect_includes"
xdebug.collect_params   This setting has been removed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#removed-"xdebug.collect_params" This setting has been removed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#removed-"xdebug.collect_params"
xdebug.collect_return   Off Off
xdebug.collect_vars This setting has been removed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#removed-"xdebug.collect_vars"   This setting has been removed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#removed-"xdebug.collect_vars"
xdebug.connect_timeout_ms   200 200
xdebug.coverage_enable  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.coverage_enable"    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.coverage_enable"
xdebug.default_enable   This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.default_enable" This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.default_enable"
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  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.gc_stats_enable"    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.gc_stats_enable"
xdebug.gc_stats_output_dir  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.gc_stats_output_dir"    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.gc_stats_output_dir"
xdebug.gc_stats_output_name gcstats.%p  gcstats.%p
xdebug.halt_level   0   0
xdebug.idekey   no value    no value
xdebug.log  no value    no value
xdebug.log_level    7   7
xdebug.max_nesting_level    256 256
xdebug.max_stack_frames -1  -1
xdebug.mode debug   debug
xdebug.output_dir   /tmp    /tmp
xdebug.overload_var_dump    This setting has been removed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#removed-"xdebug.overload_var_dump"  This setting has been removed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#removed-"xdebug.overload_var_dump"
xdebug.profiler_append  Off Off
xdebug.profiler_enable  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.profiler_enable"    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.profiler_enable"
xdebug.profiler_enable_trigger  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.profiler_enable_trigger"    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.profiler_enable_trigger"
xdebug.profiler_enable_trigger_value    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.profiler_enable_trigger_value"  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.profiler_enable_trigger_value"
xdebug.profiler_output_dir  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.profiler_output_dir"    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.profiler_output_dir"
xdebug.profiler_output_name cachegrind.out.%p   cachegrind.out.%p
xdebug.remote_autostart This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_autostart"   This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_autostart"
xdebug.remote_connect_back  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_connect_back"    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_connect_back"
xdebug.remote_enable    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_enable"  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_enable"
xdebug.remote_host  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_host"    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_host"
xdebug.remote_log   This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_log" This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_log"
xdebug.remote_log_level This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_log_level"   This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_log_level"
xdebug.remote_mode  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_mode"    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_mode"
xdebug.remote_port  This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_port"    This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_port"
xdebug.remote_timeout   This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_timeout" This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.remote_timeout"
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   This setting has been removed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#removed-"xdebug.show_mem_delta" This setting has been removed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#removed-"xdebug.show_mem_delta"
xdebug.start_upon_error default default
xdebug.start_with_request   1   1
xdebug.trace_enable_trigger This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.trace_enable_trigger"   This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.trace_enable_trigger"
xdebug.trace_enable_trigger_value   This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.trace_enable_trigger_value" This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.trace_enable_trigger_value"
xdebug.trace_format 0   0
xdebug.trace_options    0   0
xdebug.trace_output_dir This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.trace_output_dir"   This setting has been changed,see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-"xdebug.trace_output_dir"
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

xdebug_info() 来自浏览器

Version 3.0.1

Feature Enabled/disabled    Docs
Development Aids    ✘ disabled  ?
Coverage    ✘ disabled  ?
GC Stats    ✘ disabled  ?
Profiler    ✘ disabled  ?
Step Debugger   ✔ enabled   ?
Tracing ✘ disabled  ?
Diagnostic Log
Message Docs
⚠️  [Step Debug] Creating socket for '127.0.0.1:9003',poll success,but error: Operation Now in progress (29). ?
?  [Step Debug] Could not connect to debugging client. Tried: 127.0.0.1:9003 (through xdebug.client_host/xdebug.client_port) :-(   ?
PHP
Build Configuration
Version 7.4.13
Debug Build no
Thread Safety   disabled
Settings
Configuration File (PHP.ini) Path   /etc/PHP/7.4/cli
Loaded Configuration File   /etc/PHP/7.4/fpm/PHP.ini
Scan this dir for additional .ini files /etc/PHP/7.4/fpm/conf.d
Additional .ini files parsed    /etc/PHP/7.4/fpm/conf.d/10-MysqLnd.ini,/etc/PHP/7.4/fpm/conf.d/10-opcache.ini,/etc/PHP/7.4/fpm/conf.d/10-pdo.ini,/etc/PHP/7.4/fpm/conf.d/15-xml.ini,/etc/PHP/7.4/fpm/conf.d/20-calendar.ini,/etc/PHP/7.4/fpm/conf.d/20-ctype.ini,/etc/PHP/7.4/fpm/conf.d/20-curl.ini,/etc/PHP/7.4/fpm/conf.d/20-dom.ini,/etc/PHP/7.4/fpm/conf.d/20-exif.ini,/etc/PHP/7.4/fpm/conf.d/20-ffi.ini,/etc/PHP/7.4/fpm/conf.d/20-fileinfo.ini,/etc/PHP/7.4/fpm/conf.d/20-ftp.ini,/etc/PHP/7.4/fpm/conf.d/20-gd.ini,/etc/PHP/7.4/fpm/conf.d/20-gettext.ini,/etc/PHP/7.4/fpm/conf.d/20-iconv.ini,/etc/PHP/7.4/fpm/conf.d/20-imagick.ini,/etc/PHP/7.4/fpm/conf.d/20-imap.ini,/etc/PHP/7.4/fpm/conf.d/20-intl.ini,/etc/PHP/7.4/fpm/conf.d/20-json.ini,/etc/PHP/7.4/fpm/conf.d/20-mbstring.ini,/etc/PHP/7.4/fpm/conf.d/20-MysqLi.ini,/etc/PHP/7.4/fpm/conf.d/20-pdo_MysqL.ini,/etc/PHP/7.4/fpm/conf.d/20-phar.ini,/etc/PHP/7.4/fpm/conf.d/20-posix.ini,/etc/PHP/7.4/fpm/conf.d/20-readline.ini,/etc/PHP/7.4/fpm/conf.d/20-shmop.ini,/etc/PHP/7.4/fpm/conf.d/20-simplexml.ini,/etc/PHP/7.4/fpm/conf.d/20-soap.ini,/etc/PHP/7.4/fpm/conf.d/20-sockets.ini,/etc/PHP/7.4/fpm/conf.d/20-sysvmsg.ini,/etc/PHP/7.4/fpm/conf.d/20-sysvsem.ini,/etc/PHP/7.4/fpm/conf.d/20-sysvshm.ini,/etc/PHP/7.4/fpm/conf.d/20-tokenizer.ini,/etc/PHP/7.4/fpm/conf.d/20-xdebug.ini,/etc/PHP/7.4/fpm/conf.d/20-xmlreader.ini,/etc/PHP/7.4/fpm/conf.d/20-xmlrpc.ini,/etc/PHP/7.4/fpm/conf.d/20-xmlwriter.ini,/etc/PHP/7.4/fpm/conf.d/20-xsl.ini,/etc/PHP/7.4/fpm/conf.d/20-zip.ini

解决方法

LazyOne 在评论中帮我解决了这个问题。显然,我的设置的唯一问题是从这里 https://www.jetbrains.com/help/phpstorm/remote-debugging-via-ssh-tunnel.html 在端口 9003(用于 Xdebug3)上创建 SSH 隧道。 您也可以在 mobaxterm 上进行,而不仅仅是在 puTTY 上。我已经检查过,两者都运行良好。

还要确保检查防火墙 sudo ufw status 以确保您的 VM 防火墙允许端口 9003/tcp 连接。

我的 Xdebug.iniXdebug 3 现在看起来像这样:

zend_extension=xdebug.so
xdebug.mode = debug
xdebug.client_host = 127.0.0.1
xdebug.client_port = 9003
xdebug.start_with_request=yes
xdebug.log="/var/log/nginx/xdebug.log"
xdebug.idekey = PHPSTORM
xdebug.discover_client_host=false

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...