V
V
Vladislav Olegovich2020-10-15 16:31:26
PHP
Vladislav Olegovich, 2020-10-15 16:31:26

Why is there an error when trying to debug: Error: spawn php ENOENT?

I'm trying to enable debugging for php in Visual Code using XDebug, but an error pops up:
5f884cf6dc1b2410080017.png
I seem to have already done everything according to the guides from the Internet, I have XAMMP, which already has XDebug.dll, so I added php.ini like this:

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
zend_extention = D:\prog\serv\php\ext\php_xdebug.dll

Configured the path to php in the Visual Code settings:
"php.validate.executablePath": "D:\\prog\\serv\\php\\php.exe",


I restarted VSCode and the server in XAMPP and it did not help, the error remained. All paths are correct, I tried with different slashes in the path, it did not help either.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2020-10-16
@SilenceOfWinter

PHP extensions come without a file extension and most likely without specifying the path
zend_extension = xdebug
, and options like this:

xdebug.idekey = "PHPDEBUG"
xdebug.remote_enable = on
xdebug.remote_connect_back = on
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question