Reputation: 71
When I try to debug my php code I get the error:
Error: spawn php ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:84:9) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn php',
path: 'php',
spawnargs: [
'c:\\xampp\\htdocs\\fantatools\\wordpress\\wp-content\\themes\\feisar\\api\\calendario.php'
]
}
I followed the xdebug wizard instruction but it's still not working:
php_xdebug-2.9.1-7.3-vc15-x86_64.dll
C:\xampp\php\ext
C:\xampp\php\php.ini
C:\WINDOWS\php.ini
and add the line
zend_extension =
C:\xampp\php\ext\php_xdebug-2.9.1-7.3-vc15-x86_64.dll
zend_extension =
C:\xampp\php\ext\php_xdebug-2.9.1-7.3-vc15-x86_64.dll
is below the
line for OPcache.Upvotes: 3
Views: 4731
Reputation: 71
I had the same error message, but with xdebug 3.0.1, and it turns out that the traditional method for setting the xdebug has changed. Currently starting xdebug3 is as follows:
VS Code (launch.js)
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"your filepath": "${workspaceRoot}",
}
}
]
}
PHP INI
[xdebug]
zend_extension="your xdebug library"
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.discover_client_host = true
You will find more information at this link: https://github.com/felixfbecker/vscode-php-debug/issues/411
Upvotes: 1