2017年3月4日土曜日

Visual Studio Code で XAMPP Lite と組み合わせたデバッグ環境

Visual Studio Code をインストール後、XAMPP Lite の php.ini に下記を追記。
※ XAMPP は D フォルダ配下にインストールしています。


D:\xampp\php\php.ini
[XDebug]
zend_extension="D:\XAMPP\php\ext\php_xdebug.dll"
;xdebug.remote_enable=On
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler=dbgp


D:\xampp\htdocs\.vscode\launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000
        }
    ]
}

0 件のコメント:

コメントを投稿