Setting up debugging with Xdebug and vscode-php-debug #7574
-
Hello, I found this article about setting up Xdebug in Neovim using DAP and vscode-php-debug. I've tried to do something similar in Helix. So far I've been able to set up a debugger template to start the debug adapter but it crashes Helix on breakpoints with the message below:
I'm not sure if this is because I'm still figuring out how to configure the debugger or because debugging is still experimental. Has anyone else got experience with this? I've used the configuration below in [[language]]
name = "php"
[language.debugger]
name = "vscode-php-debug"
transport = "tcp"
command = "node"
args = [ "<path to phpDebug.js>" ]
port-arg = "--server={}"
[[language.debugger.templates]]
name = "Listen for Xdebug"
request = "launch"
completion = [ "ignored" ]
args = { } |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 12 replies
-
Have you ever resolved this? I also wonder if you provided the right args to the phpDebug.js config. |
Beta Was this translation helpful? Give feedback.
-
Try this. Make sure xdebug is connecting on port 9003. [language.debugger]
name = "vscode-php-debug"
transport = "stdio"
command = "node"
args = ["/Users/me/.vscode/extensions/xdebug.php-debug-1.33.0/out/phpDebug.js"]
[[language.debugger.templates]]
name = "Listen for Xdebug"
request = "launch"
completion = ["ignored"]
args = {serverSourceRoot="/path/in/container",localSourceRoot="/path/on/host"} |
Beta Was this translation helpful? Give feedback.
-
I am seeing the same problem in my setup but I am not sure that to put in for [[language]]
name = "php"
auto-format = true
[language.debugger]
name = "vscode-php-debug"
transport = "stdio"
command = "node"
args = ["/Users/chartjes/vscode-php-debug/out/phpDebug.js"]
[[language.debugger.templates]]
name = "Listen for Xdebug"
request = "launch"
completion = ["ignored"]
args = {serverSourceRoot="/Users/chartjes/ibl.dev/webreg/",localSourceRoot="/Users/chartjes/ibl.dev/webreg/"} |
Beta Was this translation helpful? Give feedback.
-
Still having the same issue and debugging works okay both in NeoVim and PhpStorm. I appreciate all the help but I have sunk enough time into this for now. |
Beta Was this translation helpful? Give feedback.
-
DAP crashes as soon as the breakpoint is hit with the container config. With serverSourceRoot and localSourceRoot being deprecated, would it be possible to configure the pathMappings variable in languages.toml? How would one go about doing it considering the setting expects a table with a path as the key? |
Beta Was this translation helpful? Give feedback.
Try this. Make sure xdebug is connecting on port 9003.