调试器未连接 - Xdebug - Atom(php)

3

我正在尝试在Atom上安装xdebug,以便在wamp服务器上调试我的Magento 2代码。根据我的phpinfo()文件,我认为我已经成功安装了xdebug,但是当我要在Atom中连接调试器时,xdebug并没有出现。

我的php.ini设置如下:

 ; XDEBUG Extension
 [xdebug]
 zend_extension ="c:/wamp64/bin/php/php7.1.16/zend_ext/php_xdebug-2.6.0-7.1- 
 vc14-x86_64.dll"
 xdebug.remote_host=127.0.0.1
 xdebug.remote_enable = 1
 xdebug.remote_connect_back=1
 xdebug.remote_port = 9000
 xdebug.remote_handler=dbgp
 xdebug.remote_mode=req
 xdebug.remote_autostart=true
 ;xdebug.profiler_enable = off
 ;xdebug.profiler_enable_trigger = Off
 ;xdebug.profiler_output_name = cachegrind.out.%t.%p
 ;xdebug.profiler_output_dir ="c:/wamp64/tmp"
 ;xdebug.show_local_vars=0

我无法在网上找到一份完整的编程教程。我曾经尝试过Atom教程, 但是失败了。我认为问题可能出在IDE密钥上,因为我不确定该怎么做。我几乎看遍了每一个YouTube视频,但似乎我还是做错了什么。 如果有人能发布一个可行的教程,我将非常感激。提前致谢 :)

问题截图

PHP版本7.1.16 Xdebug版本2.6.1


它可以直接在NetBeans和Eclipse上使用(需要一些参数更改)。 - RiggsFolly
我对Atom和Xdebug都不太熟悉,这并没有帮助。教程也没有提供太多帮助。 - user9599007
考虑了一下,我把参数改成了........ - RiggsFolly
xdebug.profiler_output_dir = "d:/wamp/tmp/xdebug" xdebug.profiler_output_name = "cachegrind.out.%p" xdebug.profiler_enable = 0 xdebug.profiler_append=0 xdebug.extended_info=1 xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.idekey=xdebug xdebug.max_nesting_level = 400; xdebug.remote_cookie_expire_time = 9000 xdebug.remote_log="d:/wamp/tmp/xdebug/xdebug_remot.log" xdebug.show_exception_trace=0 xdebug.show_local_vars=9 xdebug.show_mem_delta=0 xdebug.trace_format=0 - RiggsFolly
还没有解决它,我转而使用Visual Studio Code,它已经设置好了。 - user9599007
显示剩余5条评论
1个回答

0

我在问题的评论区看到你已经转移到了Visual Studio Code,但我还是会写下这个答案,因为其他人可能会发现它有用。

我也遇到了这个问题:“调试器未连接”。

当你安装php-debug时,它需要另一个包:atom-debug-ui - 这不是问题所在。

一旦安装了php-debug,它还建议安装更多的包:ide-phpatom-ide-ui。后者可能会有问题,因为它还包含自己的调试器UI。

因此,当你安装了这四个包时,Atom IDE上会运行两组调试器UI。

为了解决这个问题,您应该做的是禁用atom-ide-ui的调试器。您也可以卸载atom-ide-ui,因为它不是php-debug运行所必需的。如果ide-php包依赖于atom-ide-ui,那么您也可以卸载ide-php
我理解这个问题是关于在WAMP上运行的设置。我已经写了这篇文章,介绍如何在基于Ubuntu的Linux上进行设置。在那篇文章中,我提供了您需要的所有详细信息。我认为将这些信息翻译成基于Windows的设置并不太难。

安装xdebug后,IDE显示此消息:“调试器未附加”。在php --version中,xdebug显示为版本。 - sandeep jain

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接