I have some days trying to use xdebug in Visual Studio Code, but I’m unable.
I followed steps indicated in this URL: 3.2.1.4. Docker on Linux: Xdebug for Visual Studio Code — Devilbox 1.0 documentation
But I receive this error:
Error: spawn /usr/local/etc/php ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /usr/local/etc/php',
path: '/usr/local/etc/php',
spawnargs: [
'-dxdebug.start_with_request=yes',
'/home/daniel/devilbox/data/www/pruebas/htdocs/index.php'
]
}
My VSC’s settings.json is the following:
{
"workbench.colorTheme": "Default Dark+",
"diffEditor.ignoreTrimWhitespace": false,
"php.debug.executablePath": "/usr/local/etc/php",
"files.autoSave": "afterDelay",
"tabnine.experimentalAutoImports": true,
"todohighlight.isEnable": false,
"php.validate.executablePath": ""
}
And my VSC’s launch.json is the following:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"cwd": "${workspaceRoot}",
"type": "php",
"request": "launch",
"port": 9000, // I also tried with port 9000
"pathMappings": {
"/shared/httpd/pruebas/htdocs": "${workspaceFolder}/htdocs"
},
"log": true,
"xdebugSettings": {
"max_children": 128,
"max_data": 512,
"max_depth": 3
}
}
]
}
If I assign “/php” in “php.debug.executablePath”, then I receive next error:
Error: spawn /php EACCES
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -13,
code: 'EACCES',
syscall: 'spawn /php',
path: '/php',
spawnargs: [
'-dxdebug.start_with_request=yes',
'/home/daniel/devilbox/data/www/pruebas/htdocs/index.php'
]
}
Like mentioned in this thread: EACCES: permission denied in VS Code MAC
I tried using:
chown -R daniel /php
But it does not work.
Grateful in advance for any help.