I'm trying to configure Xdebug to work with Sublime Text 3 but I can't get anything to show in the Context, Watch or Stack tabs e.g. by setting a breakpoint and clicking Start Debugging (Launch Browser). The browser opens the index.php file with ?XDEBUG_SESSION_START=sublime.xdebug
appended to the url but execution of the code does not stop when the breakpoint is reached.
I've also tried adding xdebug_break()
to index.php to no effect.
From what I've read, specifying path_mapping
in the .sublime-project
file seems the most likely solution. The documentation states that:
path_mapping
For remote debugging to resolve the file locations it is required to configure the path mapping with the server path as key and local path as value.
I'm using IIS on Windows 10 so the app's files are stored in C:\inetpub\wwwroot\
and the homepage's url is http://localhost/index.php
which I'm assuming are the server path and local path respectively and as such the .sublime-project
file looks like this:
{
"folders":
[
{
"path": "."
}
],
"settings": {
"xdebug": {
"url": "http://localhost/index.php",
"path_mapping" : {"C:\\inetpub\\wwwroot\\" : "http://localhost/index.php"}
}
}
}
Is this correct? If it is, is my php.ini file configured correctly?
[ExtensionList]
.
.
.
zend_extension = "C:\Program Files (x86)\PHP\php-5.6.30-nts-Win32-VC11-x86\ext\php_xdebug-2.5.1-5.6-vc11-nts.dll"
[XDEBUG]
xdebug.default_enable=1
xdebug.remote_autostart=0
xdebug.remote_connect_back=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_host=localhost