Vscode php debug F5后没有反应

 

Vscode php debug F5后没有反应。

之前是可以用的,不知道什么原因,排查了一下发现之前的配置文件没有了

 

检查步骤:

1、先在vscode中安装PHP Debug,在设置添加"php.validate.executablePath"项,选中对应版本的php.exe。

     "php.validate.executablePath": "c:\\wamp\\bin\\php\\php7.2.14\\php.exe",

 2、按F5调试,选择PHP,就可以了,可能会配置失败。

3、按 Ctrl+Shift+D 打开调试面板,点击上面的小齿轮打开launch.json,如果出现"Listen for XDebug"和"Launch currently open script",就证明成功了,

可以调试了。

4、如果发现没有,就需要手动添加了:

{

// 使用 IntelliSense 了解相关属性。

// 悬停以查看现有属性的描述。

// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387

"version": "0.2.0",

"configurations": [

{

"name": "Listen for XDebug",

"type": "php",

"request": "launch",

"port": 9000

},

{

"name": "Launch currently open script",

"type": "php",

"request": "launch",

"program": "${file}",

"cwd": "${fileDirname}",

"port": 9000

}

]

}

将配置文件添加后,又可以debug了好开心,又可以写bug 了。

 _______________________________________

2020.11.25 更新

在php.ini 配置文件中一定要加上这一行,否则vscode可能还是不起作用

xdebug.remote_autostart = 1

 

其他配置:

xdebug.remote_enable = 1
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1

 

无效的情况下,务必检查以上配置项是否都在。

此处我的端口没有修改,默认9000,所以没有配置。

 

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

 

若有帮助到您,欢迎点击推荐,您的支持是对我坚持最好的肯定(*^_^*)

posted @ 2020-07-31 11:57  刘俊涛的博客  阅读(2153)  评论(0编辑  收藏  举报