Can't get Xdebug to work with Sublime Text 3

我的梦境 提交于 2021-01-29 04:14:07

问题


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

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

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/"
        }
    }
}

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?


回答1:


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
}
...

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



来源:https://stackoverflow.com/questions/42355018/cant-get-xdebug-to-work-with-sublime-text-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!