Xdebug (Vagrant) 不适用于 SublimeText 3 [英] Xdebug (Vagrant) not working with SublimeText 3

查看:22
本文介绍了Xdebug (Vagrant) 不适用于 SublimeText 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的 Vagrant 服务器上安装了 Xdebug,并为 Sublime Text 3 安装了 XdebugClient 插件.当我开始调试时,我的页面会在浏览器中加载,但在上下文、观察或堆栈选项卡中没有任何显示.xdebug.log 文件也是空的.以下是我的设置:

I've installed Xdebug on my Vagrant server and the XdebugClient plugin for Sublime Text 3. When I start debugging, my page loads in the browser but nothing shows up in the context, watch or stack tabs. The xdebug.log file is also empty. The following are my settings:

php.ini

[CUSTOM]

error_reporting=1
display_errors=true
track_errors=1

[xdebug ]

zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_connect_back=1
xdebug.default_enable=1
xdebug.remote_autostart=0
xdebug.idekey=sublime.xdebug
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=10.0.2.15
xdebug.remote_port=9001
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp/profiler"
xdebug.remote_mode=req

xdebug.ini

zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=10.0.2.15
xdebug.remote_port=9001
xdebug.remote_log="/var/log/xdebug/xdebug.log"

.sublime_project

"settings": {
        "xdebug": {
            "url": "http://mysite.dev/",
            "path_mapping": {"/vagrant/www/mysite/dist" : "/Users/iii/Documents/Dev/vagrant/www/mysite/dist"},
            "super_globals": true,
            "close_on_stop": true,
        }
    }

Xdebug.sublime-settings

{
    "close_on_stop": true,
    "pretty_output": true,
    "launch_browser": true,
    "debug": true,
    "ide_key": "sublime.xdebug",
    "port": 9001,
}

有人能告诉我这里有什么问题吗?

Can someone please tell me what is wrong here?

推荐答案

我在使用 Vagrant/Sublime/Xdebug 时遇到了类似的问题.我发现最新版本的 Xdebug (2.6.0) 不适用于 Sublime.显然,存在 XML 格式问题.

I was facing a similar problem with Vagrant/Sublime/Xdebug. I found that the latest version of Xdebug (2.6.0) doesn't work well with Sublime. Evidently, there's an XML formatting issue.

我发现两件事都解决了问题:

I found two things that both solved the problem:

  • 恢复到 Xdebug 2.5.5,或
  • 在您的配置中设置 "super_globals": false,.

(https://github.com/martomo/SublimeTextXdebug/issues/172)

预计到 2018 年 10 月 24 日:

ETA 24 Oct 2018:

就我而言,上述解决方案不一定是解决方案,只是在某些情况下有助于避免真正的问题.真正的修复似乎需要对 Sublime 包进行更改:https://github.com/martomo/SublimeTextXdebug/issues/172#issuecomment-410478057

In my case, the solutions above were not necessarily a fix, but just helped to avoid the real issue in some cases. The real fix appears to require a change to the Sublime Package: https://github.com/martomo/SublimeTextXdebug/issues/172#issuecomment-410478057

我最终分叉了 SublimeTextXdebug(假设这是您正在使用的包),修补它,然后用修补过的版本替换包.(主存储库中有一个拉取请求,但我认为还没有拉取.)

I ended up forking the SublimeTextXdebug (assuming this is the package you're using), patching it, and then replacing the package with the patched version. (There's a pull request in the main repository, but I don't think it's been pulled yet.)

这篇关于Xdebug (Vagrant) 不适用于 SublimeText 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆