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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。