ctrl+shift+p彈出選擇框
輸入: extensions:install extension
輸入:php debug 安裝
輸入:php litellisense 安裝
然后在上欄工具那里選擇"調(diào)試"->"添加配置",修改內(nèi)容為:
{
? ? // 使用 IntelliSense 了解相關(guān)屬性。
? ? // 懸停以查看現(xiàn)有屬性的描述。
? ? // 欲了解更多信息,請?jiān)L問: https://go.microsoft.com/fwlink/?linkid=830387
? ? "version": "0.2.0",
? ? "configurations": [
? ? ? ? {
? ? ? ? ? ? "name": "Listen for XDebug",
? ? ? ? ? ? "type": "php",
? ? ? ? ? ? "request": "launch",
? ? ? ? ? ? "port": 9007,
? ? ? ? ? ? "pathMappings": {
? ? ? ? ? ? ? ? // "容器中對應(yīng)的項(xiàng)目地址": "本機(jī)項(xiàng)目地址" // 絕對路徑
? ? ? ? ? ? ? ? "/usr/local/nginx/html/": "/usr/local/nginx/html/"
? ? ? ? ? ? }
? ? ? ? },
? ? ? ? {
? ? ? ? ? ? "name": "Launch currently open script",
? ? ? ? ? ? "type": "php",
? ? ? ? ? ? "request": "launch",
? ? ? ? ? ? "program": "${file}",
? ? ? ? ? ? "cwd": "${fileDirname}",
? ? ? ? ? ? "port": 9007
? ? ? ? }
? ? ]
}