配置Xdebug的时候在网上找了资料,怎么配都不对,最后参照着官方文档配置好了,这里给出我的解决办法
- 获取自己phpinfo的内容
直接新建一个文件输入
<?
phpinfo();
然后在页面中ctrl+A全部复制
-
打开Xdebug 安装向导,phpinfo粘贴到框中
image.png -
之后会提示你下载php对应版本的Xdebug扩展,并且放到对应目录下
image.png 如果要开启远程调试,在php.ini中加入下面两句话
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
- vscode如果以上方法都尝试过了,还是不行,打开setting.json,添加自己的php路径到文件中
php.validate.executablePath":"{你的php路径}/php.exe",
参考资料:
https://www.cnblogs.com/liuxiaowei/p/8178384.html
https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug