vs code 配置 php xdebug

1.安装扩展 php debug 

2.下载xdebug插件

做个页面输出phpinfo(),复制到这个页面 https://xdebug.org/wizard.php

提交后会告诉你机子要下载哪个版本;

注意给出的  zend_extension = 

没有带双引号的话要自己加上;

加三个配置

xdebug.remote_enable = 1
xdebug.remote_port = 9010
xdebug.remote_autostart = 1
 
注意remote_port,默认9000,如果被其他应用占了,要换一个端口,
 

 重启web服务;

vs code 切换到调试界面,点调试的绿色小箭头,选择php调试

生成一个配置文件,里面的两个端口号设置和xdebug.remote_port = 9010

一致,就可以运行浏览器调试了

猜你喜欢

转载自www.cnblogs.com/lgxtry/p/9179389.html