LoginSignup
4
5

More than 5 years have passed since last update.

xdebugでリモートデバッグ (apache on docker,Visual Studio Code)

Posted at

環境

  • macOS High Sierra
  • Docker Version 17.09.1-ce-mac42 (21090)
  • Visual Studio Code バージョン1.19.1 (1.19.1)

Visual Studio Code

  • 拡張機能[PHP Debug]をインストール
  • デバッグしたいソースのあるフォルダを開き[shift + cmd + d]を押下しデバッグウィンドウを開く
  • 構成の追加から以下の構成を追加する
{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "XDebug on docker",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "pathMappings": {
                // {apache上のdocument root}:{ローカルのdocument root}
                "/var/www/html":"${workspaceRoot}/"
            }
        }
    ]
}
docker上のソースのパス ローカルのソースのパス Visual Studio Codeで開いたフォルダ
/var/www/html/hello.php ~/www/html/hello.php ~/www/html
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5