安装vscode插件 PHP Debug(ctrl+shift+x)

进入Xdebug 官网

安装哪个版本

可以本地浏览器http://127.0.0.1/?phpinfo=-1

复制整个页面内容(ctrl+a、ctrl+c)

进入Xdebug帮助页面,粘贴刚才的内容进去;

下载安装

配置php.ini

因为Xdebug 2和3.* 不太一样,配置文件需要更新

; XDEBUG Extension 3.0

zend_extension = xdebug

xdebug.mode=debug

xdebug.start_with_request=yes

xdebug.client_host=127.0.0.1

xdebug.port=9003

VScode 配置

setting.json l里面添加debug路径

"php.debug.executablePath": "c:\\wamp\\bin\\php\\php7.3.21\\php.exe",

进入debug设置(ctrl+shift+d),点击设置 生成默认的 配置;

{

"version": "0.2.0",

"configurations": [

{

"name": "Listen for XDebug",

"type": "php",

"request": "launch",

"port": 9003

},

{

"name": "Launch currently open script",

"type": "php",

"request": "launch",

"program": "${file}",

"cwd": "${fileDirname}",

"port": 9003

}

]

}

重启wamp即可;

文章来源:刘俊涛的博客 欢迎关注公众号、留言、评论,一起学习。

若有帮助到您,欢迎捐赠支持,您的支持是对我坚持最好的肯定(_)

文章来源

评论可见,请评论后查看内容,谢谢!!!评论后请刷新页面。