Vscode或者Trae里面来配置Xdebug调试webman框架

zhezhebie

直接上效果图:
截图

其实很简单,但是网上说的乱七八糟,实在看不下去了。

修改配置

D:\ProjectsWechat\KiddoPath.vscode\launch.json

"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"log": true,
"port": 9004
},
....

xdebug的配置:

[xdebug]
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_port=9004
xdebug.client_host=127.0.0.1
xdebug.log=xdebug.log
xdebug.log_level=7
xdebug.idekey=VSCODE

如果是docker里面的php就下面这样配置就行了:

[xdebug]
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_port=9004
xdebug.remote_host=host.docker.internal  # 注意这里,这里是宿主机的ip
xdebug.remote_log=/var/log/php/xdebug.log
xdebug.remote_log_level=7
xdebug.idekey=VSCODE

祝大家开发顺利

53 0 1
0个评论

zhezhebie

340
积分
0
获赞数
0
粉丝数
2023-03-30 加入
🔝