LoginSignup
1
1

More than 3 years have passed since last update.

VSCode + Xdebug + AWS(EC2, Ubuntu18.04)の設定

Last updated at Posted at 2019-08-21

PortForwardの設定がポイントかな。AWSのインバウンド・アウトバウンドには追記の必要なし。

TeratermのTERATERM.INIに追記


DefaultForwarding=R9001:localhost:9001

TeratermでAWSに接続

ポートフォワーディングセットしてから接続。

xdebugインストール

apt install php-xdebug

php.iniに追記

/etc/php/7.2/cli/php.ini #cliでも使いたいなら
/etc/php/7.2/apache2/php.ini
に追記。

xdebug.remote_port=9001
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=localhost
xdebug.remote_log=/tmp/xdebug.log

※ xdebug.soの追記は不要。

VSCodeの設定

launch.json

{
    "version": "0.2.0",
    "configurations": [      
        {
            "name": "xdebug",
            "type": "php",
            "request": "launch",
            "port": 9001,
            "pathMappings": {
                "/var/www/html": "${workspaceFolder}"
            }
        }
    ]
}
1
1
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
1
1