无法让 Xdebug 与 Sublime Text 3 一起使用 [英] Can't get Xdebug to work with Sublime Text 3

查看:66
本文介绍了无法让 Xdebug 与 Sublime Text 3 一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Nginx 和 PHP 5.5.29(使用 php-fpm),安装了 xdebug通过包控制.

I'm using Nginx and PHP 5.5.29 (with php-fpm), installed xdebug through package control.

这是我在 php.ini 中的 xdebug 配置

This is my xdebug config in php.ini

zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.remote_log = "/var/log/xdebug/xdebug.log"
xdebug.var_display_max_depth = 5
xdebug.var_display_max_data = 2048

这是 sublime text 项目的配置:

This is the sublime text project's configuration:

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": "/home/user/repositories/example1"
        }
    ],
    "settings":
    {
        "default_encoding": "UTF-8",
        "fallback_encoding": "UTF-8",
        "xdebug":
        {
            "url": "http://example1/"
        }
    }
}

当我通过工具">Xdebug">开始调试"(启动浏览器)开始调试时,它会打开一个带有以下 URL 的选项卡:http://example1/?XDEBUG_SESSION_START=sublime.xdebug
但它不尊重我的断点,并且在 Xdebug Stack、Contexto 和 Watch 窗口中不显示任何内容.
此外,我的应用程序中的任何其他链接都没有 xdebug 查询字符串.

When I start debugging through Tools > Xdebug > Start Debugging (launch browser) it opens up a tab with the following URL: http://example1/?XDEBUG_SESSION_START=sublime.xdebug
but it doesn't respect my breakpoints and doesn't show anything in Xdebug Stack, Contexto and Watch windows.
Also, any other links inside my application doesn't have the xdebug querystring.

我该如何解决这个问题?

How do I solve this?

推荐答案

我不得不在 php.ini 中将端口更改为 9500 并将其添加到 sublime text 项目的文件中:

I had to change port to 9500 in php.ini and add that in the sublime text project's file:

...
"xdebug":
{
    "url": "http://example1/",
    "port": 9500
}
...

之后我关闭了 Sublime Text,重新启动了 nginx 和 php-fpm,然后再试了一次,一切终于正常了!

After that I closed Sublime Text, restarted nginx and php-fpm and than tried again, everything is finally working!

这篇关于无法让 Xdebug 与 Sublime Text 3 一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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