先按照這個搭建
要注意的幾個點
上文中的4.2. 配置Visual Studio Code 指定php的路徑
配置 PHP Debug
配置完成后 文件夾下后有個 .vscode 文件夾 下有個 launch.json
內容如下
{
// 使用 IntelliSense 了解相關屬性。
// 懸停以查看現有屬性的描述。
// 欲了解更多信息,請訪問: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
特別說明 PHP Debug必須通過打開文件夾中的文件才能調試
必須要打開www目錄 把你要調試的代碼放在這個目錄下
端口要用WAMP給定的 而不是vscode的launch.json中的9000
打斷點調試