xdebug / vscode-php-debug

PHP Debug Adapter for Visual Studio Code 🐞⛔
MIT License
780 stars 178 forks source link

"felixbecker-php-debug" dependency issue #839

Closed pediRAM closed 2 years ago

pediRAM commented 2 years ago

VSCode cannot activate PHP Debug extension

xdebug was working well... I don't know how (IMHO: auto update) and why, but now I get the error message "PHP Xdebug cannot be activated..." because the dependency "felixbecker.php-debug"...

I have searched the web, found some solutions (on stackoverflow.com), which I tried without success:

Also, there is another issue that confuses me:

"The path to a PHP executable." What does this mean? Any executable PHP script? PHP.exe? Xdebug.exe? The "...php/bin/" directory where "php" executable is?

An explicit or more intuitive message would make it more user-friendly (IMHO).

2022-09-10 10_38_16-Einstellungen - trunk - Visual Studio Code

I am working on Win7 x64.

PHP version: 8.1.7 Xdebug version: 3.1.5 VS Code extension version: 1.28.0

Your launch.json: Xdebug php.ini config:

[PHP]
zend_extension = xdebug

[xdebug]
xdebug.mode=debug
xdebug.client_host = localhost
xdebug.client_port = ${PHP_XDEBUG_REMOTE_PORT}
xdebug.discover_client_host = false
xdebug.start_with_request = ${PHP_XDEBUG_REMOTE_AUTOSTART}
xdebug.idekey = ${PHP_XDEBUG_IDE_KEY}
xdebug.output_dir =T:\MyTemp\Logs\xdebug\output
xdebug.log =T:\MyTemp\Logs\xdebug.log

VSCode Error Message: 2022-09-10 10_27_58-index php - trunk - Visual Studio Code

zobo commented 2 years ago

Hi @pediRAM !

First the question.

"The path to a PHP executable." is the path to php.exe and is used when starting a script to debug. For example with the debug configuration "Launch currently open script". It can also be overridden in launch,json.

Regarding the other error. This is a bit strange, I have not yet seen it.

Try to uninstall the PHP Debug extension, make sure there are not two, then go to your Windows user folder and make sure the extension is deleted: delete folder .vscode\extensions\xdebug.php-debug-1.28.0.

If that doesn't work, try to delete VSIX cache under AppData\Roaming\Code\CachedExtensionVSIXs.

Hope this helps.

pediRAM commented 2 years ago

Hi @zobo ! It works like a charm! Thank you very much!

As you recommended:

  1. I uninstalled all PHP-Debug extensions
  2. closed vscode
  3. deleted in my user folder (c:\users\my_user_name) the file ".vscode\extensions\xdebug.php-debug-1.28.0"
  4. then I deleted all files in "AppData\Roaming\Code\CachedExtensionVSIXs"
  5. started vscode
  6. installed PHP Debug extension Everything is working fine now.