Docker容器内PHP项目使用Visual Studio Code配置XDebug

Posted by Y Cheung on Tue, Apr 10, 2018

以下VSCODE XDEBUG 配置文件使用场景:项目在docker内运行(docker内项目位置为/var/www/html),项目代码映射在docker外,vscode编辑器安装在docker外。

 1{
 2    // 使用 IntelliSense 了解相关属性。 
 3    // 悬停以查看现有属性的描述。
 4    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
 5    "version": "0.2.0",
 6    "configurations": [
 7        {
 8            "name": "Listen for XDebug",
 9            "type": "php",
10            "request": "launch",
11            "port": 9000,
12            "pathMappings": {
13                "/var/www/html":"${workspaceRoot}"
14            }
15        }
16    ]
17}