Breakpoints are skipped while debugging PHP application with Sublime Text 3
Hi,
I have been trying to debug a PHP application on LAMPP stack from Sublime Text 3, but the browser loads the page completely without hitting any of the breakpoints I have set in them. I am running the LAMPP stack on Ubuntu 18.04 with PHP version 7.3.8 and Xdebug version 2.7.2 (installed based on the instructions from the wizard.).
Since the same Xdebug setup happen to work perfectly with VS Code, I tried comparing the Xdebug logs generated for both.
As can be seen from the log for Sublime Text run at the bottom, Xdebug recognizes the breakpoints correctly, but there is an error while communicating with the client using IPv6 address of localhost (::1). On the other hand, in the case of VS Code, the IPv6 address seems to be handled without error and the debugger works correctly.
I tried swapping the host address between 'localhost', '172.0.0.1' and '192.168.1.215' (private IP of the machine in LAN) in php.ini,
For the past couple of days I have been experimenting with various fixes suggested in different forums, but I'm no closer to a solution yet.
Can you please shed some light on this? I have pasted the contents of the configuration files and the logs below.
Environment
Sublime Text
Operating system: Ubuntu 18.04 Installed version/build: Sublime Text 3 v3.2.1 Python version: 3.3.6
Server
LAMPP stack running on Ubuntu 18.04 PHP/Xdebug version: PHP 7.3.8 / Xdebug 2.7.2
Configuration
php.ini/xdebug.ini
zend_extension=/opt/lampp/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so
[XDebug]
xdebug.remote_enable=1
xdebug.remote_autostart=true
xdebug.remote_host=192.168.1.215
xdebug.remote_connect_back=1 ; Not safe for production servers
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_log=/tmp/xdebug.log
xdebug.idekey=sublime.xdebug
Packages/User/Xdebug.sublime-settings
{
"path_mapping": {
"/opt/lampp/htdocs/" : "/opt/lampp/htdocs/"
},
"url": "http://192.168.1.215/index.php",
"ide_key": "sublime.xdebug",
"host": "192.168.1.215",
"port": 9000,
"max_children": 32,
"max_data": 1024,
"max_depth": 1,
"break_on_start": false,
"break_on_exception": [
"Fatal error",
"Catchable fatal error",
"Warning",
"Parse error",
"Notice",
"Strict standards",
"Deprecated",
"Xdebug",
"Unknown error"
],
"close_on_stop": false,
"super_globals": true,
"fullname_property": true,
"hide_password": false,
"pretty_output": false,
"launch_browser": false,
"browser_no_execute": false,
"disable_layout": false,
"debug_layout" : {
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.7, 1.0],
"cells": [[0, 0, 2, 1], [0, 1, 1, 2], [1, 1, 2, 2]]
},
"breakpoint_group": 2,
"breakpoint_index": 1,
"context_group": 1,
"context_index": 0,
"stack_group": 2,
"stack_index": 0,
"watch_group": 1,
"watch_index": 1,
"breakpoint_enabled": "circle",
"breakpoint_disabled": "dot",
"breakpoint_current": "",
"current_line": "bookmark",
"python_path" : "",
"debug": true
} *.sublime-project
{
"folders":
[
{
"follow_symlinks": true,
"path": "."
}
],
"settings": {
"xdebug": {
"url": "http://192.168.1.215/fastusvisa/",
"path_mapping": {
"/opt/lampp/htdocs/<application>" : "/opt/lampp/htdocs/<application>",
"super_globals": true,
"close_on_stop": true
},
}
}
}
Logs
Console output:
Packages/User/Xdebug.log:
Xdebug.log (successful) from VS Code
[3156] Log opened at 2019-09-23 09:15:01
[3156] I: Checking remote connect back address.
[3156] I: Checking header 'HTTP_X_FORWARDED_FOR'.
[3156] I: Checking header 'REMOTE_ADDR'.
[3156] I: Remote address found, connecting to 192.168.1.215:9000.
[3156] I: Connected to client. :-)
[3156] ->
Xdebug.log (failure) from Sublime Text 3
[3152] Log opened at 2019-09-23 09:07:08
[3152] I: Checking remote connect back address.
[3152] I: Checking header 'HTTP_X_FORWARDED_FOR'.
[3152] I: Checking header 'REMOTE_ADDR'.
[3152] I: Remote address found, connecting to 192.168.1.215:9000.
[3152] I: Connected to client. :-)
[3152] ->
I am experiencing the exact same issue. Everything works in Visual Studio Code, but error after error when using Sublime Text 3 and this plugin. I've tried everything, no dice.
@lewsid, I switched from this Package to the Debugger Package. If you have experience in using VS Code and Xdebug the Debugger Package is – in my opinion – easy to handle.
Thanks @meengit!
@vineethgk Did you find a solution? I have the same issue as well