目录
2、Visual Studio Code(VSCODE)中配置php xdebug
1、win配置php环境
1.1 配置PHPStudy
1.1.1 下载phpstudy
链接:https://pan.baidu.com/s/16EhOqcnBIDQYsTejE4cYWg
提取码:tn2z
1.1.2 配置phpstudy
如下图将php扩展组件xdebug打开(我的PHPStudy中是已经自带了这个插件的,不用再自己下载配置),并配置好监听端口,此端口不能被占用。这个端口要记住,下一步在VSCode中会做同样的端口配置,切记PHPStudy和VSCode中配置的端口号必须一致。
(本文内用的php版本是8.0.2)
然后修改php.ini配置文件,拉到最底部,修改xdebug.remote_enable=On,xdebug.remote_autostart=On,
如果没有remote_autostart这个配置就自己加上,如下图:
配置好后重启Apache服务器。
1.1.3 测试phpstudy是否配置完成
打开浏览器输入,http://localhost/test.php, 会看到 php的版本。
页面内搜索xdebug.remote_enable,查看是否配置成功。