我在 VSCode 中安装了 PHP 调试扩展,也通过分析phpinfo()
文件安装了 Xdebugger。现在我无法调试文件(前向箭头不用于调试)。
如何编写launch.json文件并开始调试?
settings.json
{
"launch": {
"configurations": [
{
"name": "Launch currently open script with Xdebug 2 (Legacy)",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.remote_enable=yes",
"-dxdebug.remote_autostart=yes"
],
"env": {
"XDEBUG_CONFIG": "remote_port=${port}"
}
},
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
}
]
}
}