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.dllC:\xampp\php\extC:\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.dllzend_extension =
C:\xampp\php\ext\php_xdebug-2.9.1-7.3-vc15-x86_64.dll is below the
line for OPcache.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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With