LoginSignup
1
0

More than 1 year has passed since last update.

Laravel Sail + Xdebug + VS Codeでのデバッグ

Last updated at Posted at 2021-08-26
  • sail artisan sail:publish を実行して Dockerfile を出す。
  • Dockerfileapt-get install -y php-xdebug を差し込む。
  • php.ini に下記追加
[XDebug]
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = host.docker.internal
  • sail build --no-cache を実行。
  • VS Codeに 拡張機能 PHP Debug を入れる。
  • .vscode/launch.json に下記設定を追加。
{
    "name": "Listen for XDebug",
    "type": "php",
    "request": "launch",
    "stopOnEntry": true,
    "port": 9003,
    "pathMappings": {
        "/var/www/html": "${workspaceFolder}"
    },
    "hostname": "localhost",
    "xdebugSettings": {
        "max_data": 65535,
        "show_hidden": 1,
        "max_children": 100,
        "max_depth": 5
    }
}
  • VSCodeにてデバッグ開始。 終わり。
1
0
1

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
1
0