Docker容器内PHP项目使用Visual Studio Code配置XDebug
以下VSCODE XDEBUG 配置文件使用场景:项目在docker内运行(docker内项目位置为/var/www/html
),项目代码映射在docker外,vscode编辑器安装在docker外。
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/var/www/html":"${workspaceRoot}"
}
}
]
}