【问题标题】:Can't get Xdebug to work with Sublime Text 3无法让 Xdebug 与 Sublime Text 3 一起使用
【发布时间】:2017-07-10 08:23:20
【问题描述】:

我正在使用 Nginx 和 PHP 5.5.29(带有 php-fpm),通过包控制安装 xdebug。

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

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 项目的配置:

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

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

我该如何解决这个问题?

【问题讨论】:

    标签: php sublimetext3 xdebug


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2018-11-22
      • 2016-01-05
      • 1970-01-01
      • 2015-07-29
      • 2017-03-31
      • 1970-01-01
      • 2013-07-27
      • 1970-01-01
      • 2015-12-31
      相关资源
      最近更新 更多