카테고리 없음

PHP 윈도우즈 디버깅

denny 2021. 11. 23. 18:19

1. visual studio code 설치

2. File > Preferences > Settings > PHP > Edit in settings.json

"php.validate.enable" : false
"php.validate.executablePath" : "E:/Bitnami/wampstack-7.1.31-0/php/php.exe"

확장탭 > PHP intellisense 설치

 

3. XDebug 설치

    참조 : https://xdebug.org/wizard 

 

Xdebug: Support — Tailored Installation Instructions

Installation Wizard This page helps you finding which file to download, and how to configure PHP to get Xdebug running. Please paste the full output of phpinfo() (either a copy & paste of the HTML version, the HTML source or php -i output) and submit the f

xdebug.org

php.ini에 dll 세팅

zend_extension = E:\Bitnami\wampstack-7.1.31-0\php\ext\php_xdebug-2.9.8-7.1-vc14-x86_64.dll

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1

4. PHP Debug 플러그인 설치

확장탭 > PHP Debug

 

5. PHP Debug 연결 설정

디버그탭 > launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Chrome",
            "request": "launch",
            "type": "pwa-chrome",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}"
        },
        {
            "name": "launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000,
            "runtimeExecutable": "E:/Bitnami/wampstack-7.1.31-0/php/php.exe"
        },
        { 
            "name": "debug for PHP", 
            "type": "php", 
            "request": "launch", 
            "port": 9000,
            "runtimeExecutable": "E:/Bitnami/wampstack-7.1.31-0/php/php.exe"
        } 
    ]
}