wamp + vscode + xdebug

xdebug的下载和配置
  • 下载xdebug, 注意PHP版本

  • 在apache下的php.ini中配置xdebug:

extension=php_xdebug
output_buffering = Off

[xdebug]
zend_extension ="D:/wamp64/bin/php/php_xdebug.dll"
xdebug.remote_enable = 1
xdebug.remote_host=127.0.0.1
xdebug.remote_handler = "dbgp"
xdebug.remote_port=9000
xdebug.remote_autostart=1
  • 配置VScode
    • 安装PHP debug插件
    • 配置php可执行路径:
        "php.validate.executablePath": "D:\\wamp64\\bin\\php\\php5.6.40\\php.exe",
        "php.validate.enable": true,
    
    • 在./vscode目录下创建launch.json文件
    {
        "version": "0.1.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
            }
        ]
    }
    
  • 重启Apache

你可能感兴趣的:(wamp + vscode + xdebug)