问题
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