直接上效果图:
其实很简单,但是网上说的乱七八糟,实在看不下去了。
D:\ProjectsWechat\KiddoPath.vscode\launch.json
"configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", "log": true, "port": 9004 }, ....
[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