本文介绍了无法在NetBeans 12.2、PHP 7.4、Ubuntu 20.04上使用XDEBUG 3.0.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想我都试过了,但我就是不能在Ubuntu 20.04上的NetBeans上使用XDEBUG,在IDE的底部显示了一条消息&等待连接(NetBeans-xDEBUG)。
如果我使用phpinfo()
,我可以看到XDEBUG已启用,下面是我的xdebug.ini配置文件:
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.discover_client_host=0
xdebug.client_port=9000
xdebug.client_host=127.0.0.1
xdebug.remote_handler=dbgp
在NetBeans中,我在选项->;PHP->;调试中的设置是:
Debugger Port: 9000
Session ID : netbeans-xdebug
Maximum Data Length : 2048
Stop at First Line : unchecked
Watches and Balloon Evaluation : unchecked
Show Requested URLs : checked
Show Debugger Console : checked
我知道这个问题被问了很多次,但大多数都是陈词滥调,没有一个答案是有效的。这快把我逼疯了,如果有任何帮助,我将不胜感激!
--编辑:
以下是xdebug.log文件的内容:
[21406] Log opened at 2021-01-21 12:42:36.233357
[21406] [Step Debug] INFO: Connecting to configured address/port: 127.0.0.1:9000.
[21406] [Step Debug] WARN: Creating socket for '127.0.0.1:9000', poll success, but error: Operation now in progress (29).
[21406] [Step Debug] ERR: Could not connect to debugging client. Tried: 127.0.0.1:9000 (through xdebug.client_host/xdebug.client_port) :-(
[21406] Log closed at 2021-01-21 12:42:36.234607
下面是xDEBUG_INFO()的输出:
PHP
Build Configuration
Version 7.4.14
Debug Build no
Thread Safety disabled
Settings
Configuration File (php.ini) Path /etc/php/7.4/cli
Loaded Configuration File /etc/php/7.4/apache2/php.ini
Scan this dir for additional .ini files /etc/php/7.4/apache2/conf.d
Additional .ini files parsed /etc/php/7.4/apache2/conf.d/10-mysqlnd.ini, /etc/php/7.4/apache2/conf.d/10-opcache.ini, /etc/php/7.4/apache2/conf.d/10-pdo.ini, /etc/php/7.4/apache2/conf.d/15-xml.ini, /etc/php/7.4/apache2/conf.d/20-calendar.ini, /etc/php/7.4/apache2/conf.d/20-ctype.ini, /etc/php/7.4/apache2/conf.d/20-curl.ini, /etc/php/7.4/apache2/conf.d/20-dom.ini, /etc/php/7.4/apache2/conf.d/20-exif.ini, /etc/php/7.4/apache2/conf.d/20-ffi.ini, /etc/php/7.4/apache2/conf.d/20-fileinfo.ini, /etc/php/7.4/apache2/conf.d/20-ftp.ini, /etc/php/7.4/apache2/conf.d/20-gd.ini, /etc/php/7.4/apache2/conf.d/20-gettext.ini, /etc/php/7.4/apache2/conf.d/20-iconv.ini, /etc/php/7.4/apache2/conf.d/20-json.ini, /etc/php/7.4/apache2/conf.d/20-mbstring.ini, /etc/php/7.4/apache2/conf.d/20-mysqli.ini, /etc/php/7.4/apache2/conf.d/20-pdo_mysql.ini, /etc/php/7.4/apache2/conf.d/20-phar.ini, /etc/php/7.4/apache2/conf.d/20-posix.ini, /etc/php/7.4/apache2/conf.d/20-readline.ini, /etc/php/7.4/apache2/conf.d/20-shmop.ini, /etc/php/7.4/apache2/conf.d/20-simplexml.ini, /etc/php/7.4/apache2/conf.d/20-sockets.ini, /etc/php/7.4/apache2/conf.d/20-sysvmsg.ini, /etc/php/7.4/apache2/conf.d/20-sysvsem.ini, /etc/php/7.4/apache2/conf.d/20-sysvshm.ini, /etc/php/7.4/apache2/conf.d/20-tokenizer.ini, /etc/php/7.4/apache2/conf.d/20-xdebug.ini, /etc/php/7.4/apache2/conf.d/20-xmlreader.ini, /etc/php/7.4/apache2/conf.d/20-xmlwriter.ini, /etc/php/7.4/apache2/conf.d/20-xsl.ini
Directive Local Value Master Value Docs
xdebug.mode debug debug 🖹
xdebug.start_with_request yes yes 🖹
xdebug.start_upon_error default default 🖹
xdebug.output_dir /tmp /tmp 🖹
xdebug.trigger_value no value no value 🖹
xdebug.file_link_format no value no value 🖹
xdebug.filename_format no value no value 🖹
xdebug.log /var/log/xdebug.log /var/log/xdebug.log 🖹
xdebug.log_level 7 7 🖹
xdebug.var_display_max_children 128 128 🖹
xdebug.var_display_max_data 512 512 🖹
xdebug.var_display_max_depth 3 3 🖹
xdebug.max_nesting_level 256 256 🖹
xdebug.cli_color 0 0 🖹
xdebug.force_display_errors Off Off 🖹
xdebug.force_error_reporting 0 0 🖹
xdebug.halt_level 0 0 🖹
xdebug.max_stack_frames -1 -1 🖹
xdebug.show_error_trace Off Off 🖹
xdebug.show_exception_trace Off Off 🖹
xdebug.show_local_vars 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.profiler_output_name cachegrind.out.%p cachegrind.out.%p 🖹
xdebug.profiler_append Off Off 🖹
xdebug.cloud_id no value no value 🖹
xdebug.client_host 127.0.0.1 127.0.0.1 🖹
xdebug.client_port 9000 9000 🖹
xdebug.discover_client_host Off Off 🖹
xdebug.client_discovery_header no value no value 🖹
xdebug.idekey no value no value 🖹
xdebug.connect_timeout_ms 200 200 🖹
xdebug.scream Off Off 🖹
xdebug.gc_stats_output_name gcstats.%p gcstats.%p 🖹
xdebug.trace_output_name trace.%c trace.%c 🖹
xdebug.trace_format 0 0 🖹
xdebug.trace_options 0 0 🖹
xdebug.collect_assignments Off Off 🖹
xdebug.collect_return Off Off 🖹
推荐答案
这只是黑魔法,但无论如何,它是有效的。非常感谢
如果它可以帮助任何人,我将xdebug.idekey设置为我的.ini文件并使其运行:
- 在NetBeans中,我单击调试项目按钮,它将开始等待xDEBUG
- 在我的浏览器(Chromium)中,我必须手动启动URL才能开始调试
我尝试使用Firefox而不是Chromium进行调试,运行正常。
这篇关于无法在NetBeans 12.2、PHP 7.4、Ubuntu 20.04上使用XDEBUG 3.0.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!