PHP + Xdebug + VS Code:Debian 10 上的错误?

PHP + Xdebug + VS Code: Bug on Debian 10?

在 Debian 10 上的 VS Code 中调试时,子程序中的局部变量在遇到断点时不会显示在 VC "Locals" 中。 示例代码:

function testbug($param1)
{
  $grappa="grappa 2";
  echo "Test: ".$grappa.$param1."</br>";
}

$grappa 变量在 Debian 上的调试会话中不显示 "Locals" 变量,但在 Ubuntu.

上存在

Debian:

Apache Version: Apache/2.4.38 (Debian)
Current PHP version: 7.3.14-1~deb10u1
Xdebug v2.7.0RC2

当 运行 在 Ubuntu 服务器上时,一切正常。

Ubuntu:

Apache Version: Apache/2.4.41 (Ubuntu)
Current PHP version: 7.3.15-1+ubuntu18.04.1+deb.sury.org+1
Xdebug v2.9.2

有人可以指教吗?我卡住了...

您正在 运行使用 Debian 和 Release Candidate (2.7.0RC2) 进行旧版 Xdebug。将 Xdebug 升级到支持的最新版本 (https://xdebug.org/docs/compat)。

使用 apt 安装 php-devphp-pear 软件包,然后 运行:pecl install xdebug。 (完整安装文档位于 https://xdebug.org/docs/install)。