【发布时间】:2021-12-23 00:05:33
【问题描述】:
大多数时候,我在 VS Code 中调试我的 PHP 代码 Xdebug 没有问题。但最近,VS Code 开始忽略我的断点,而是在随机函数声明处停止。
即它将在下面函数中的function x($a) 处停止,而不是在断点处停止:
function x($a) {
// Some code, including a line with a breakpoint
}
即使调试在函数声明处停止,我也无法进入函数中的代码。阿卡。我无法调试任何东西:恐慌:
我的launch.json:
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9090
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9090
}
]
有什么想法可以解决这个问题,这样我的 Xdebug 调试就会重新开始吗?
我已尝试重新启动 VS Code 和 Apache + 更改端口号。没有帮助。
我系统上的版本:
- 系统:Windows NT LAPTOP-612BINLI 10.0 build 19041 (Windows 10) AMD64
- Apache 版本:Apache/2.4.51 (Win64) OpenSSL/1.1.1l PHP/7.3.31
- Xdebug 版本:2.8.1
【问题讨论】:
-
确定你有最新版本吗?
-
最新版本是什么?它以前工作过。由于某种原因,它在几天前停止工作。
-
@Mads 首先说明您的操作系统、PHP 和 Xdebug 版本以及显示您的 Xdebug 配置。您可以从
phpinfo()输出中获得所有这些信息。 -
好点。已添加。
标签: php visual-studio-code xdebug