php-selen
Debug
Docker + xdebug + VS Code でステップ実行によるデバッグ環境を構築。 デバッグの手順を以下に記載する。
デバッグの準備
-
.vscode/launch.jsonファイルに以下の記述をconfigurationsに追加
{
"name": "php-xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html/": "${workspaceRoot}"
}
}- デバッグ用コンテナを起動
docker-compose up -d php-xdebugデバッグの手順
-
ブレークポイント設定
-
デバッグ実行
-
スクリプト実行
docker-compose exec php-xdebug php examples/index.php