简体   繁体   中英

Can't get Xdebug to work with Sublime Text 3

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?

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM