美文网首页
mac vscode 配置 xdebug 调试

mac vscode 配置 xdebug 调试

作者: 荔枝lizhi_iOS程序猿 | 来源:发表于2022-08-26 11:14 被阅读0次

一、下载xdebug

然后在 /Applications/XAMPP/xamppfiles/etc/php.ini 最后加上

[xdebug]
zend_extension = "/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so"
xdebug.mode = develop,debug
xdebug.remote_enable=1
xdebug.client_port=9003
xdebug.client_host=127.0.0.1
xdebug.remote_autostart=1
xdebug.start_with_request = yes
image.png

二、 vs code 下载插件 PHP Debug

image.png

需要配置 launch.json 注意port 是 你xdebug 的port 我的是默认 9003,其它应该不需要改动


image.png

三 chrome 下载 Xdebug helper (需科学上网)

image.png

四 调试

chrome 启动 xdebug helper ,debug 模式


image.png

测试在 VSCode 里面使用


f52edcedaaf34666cb00ae6c38a5208b.gif

[gif效果链接]https://attachment.wampserver.site/images/2021/06/16/f52edcedaaf34666cb00ae6c38a5208b.gif

ps: phpstorm 也可以用php.ini 的配置 ,之前用phpstrom 一直调试不成功,改了php.ini的配置 如上后,也可以调试成功了。

参考地址:https://www.kancloud.cn/q86849180/wampserver/2306253

相关文章

网友评论

      本文标题:mac vscode 配置 xdebug 调试

      本文链接:https://www.haomeiwen.com/subject/ywytnrtx.html