VSCode-XDebug加载然后不加载

时间:2019-04-30 15:07:22

标签: php visual-studio-code xdebug

我试图在Windows上将XDebug与PHP和VS Code一起使用。我已经成功安装了XDebug,因为它显示在phpinfo()页面中。

当我尝试在VS Code上使用XDebug时,出现此错误:

DEBUG     Checking PHPLS_ALLOW_XDEBUG

DEBUG     The xdebug extension is loaded (2.7.1)

DEBUG     Process restarting (PHPLS_ALLOW_XDEBUG=internal|2.7.1|0|*|*)
DEBUG     Running C:\Users\***\Documents\Applications\php-7.3.4-nts-Win32-VC15-x64\php.exe -n -c C:\Users\***\AppData\Local\Temp\AF9E.tmp c:\Users\***\.vscode\extensions\felixfbecker.php-intellisense-2.3.10\vendor\felixfbecker\language-server\bin\php-language-server.php --tcp=127.0.0.1:50124 --memory-limit=4095M

DEBUG     Checking PHPLS_ALLOW_XDEBUG

DEBUG     Restarted (64 ms). The xdebug extension is not loaded

[Info  - 11:04:12 AM] 1 files total
[Info  - 11:04:12 AM] Indexing project for definitions and static references
Parsing file:///c:/xampp/htdocs/blank/blank.php
[Info  - 11:04:12 AM] Indexing project for dynamic references
[Info  - 11:04:12 AM] 0 Packages
[Info  - 11:04:12 AM] All 1 PHP files parsed in 0 seconds. 148 MiB allocated.

1 个答案:

答案 0 :(得分:1)

我也遇到了这个问题,然后查看提供的配置(在上面的原始示例中是C:\Users\***\AppData\Local\Temp\AF9E.tmp),我发现zend_extension行已被注释掉。

即。在.tmp文件中显示为:

  

; zend_extension = php_xdebug-2.7.2-7.3-vc15-nts-x86_64.dll

分号是注释字符。

一个小小的实验表明它正在根据文件名对其进行注释。我将DLL重命名为totallynotphpdebgr272.dll,并将其设置为php.ini中的zend_extension。更改之后,它不再在生成的.tmp文件中注释该行,并且我能够在vscode中成功开始调试php。