直接上效果圖:
其實很簡單,但是網(wǎng)上說的亂七八糟,實在看不下去了。
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