【发布时间】:2020-12-25 15:36:13
【问题描述】:
鉴于我的 vscode 中的这个设置
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9003,
"hostname":"::1",
"pathMappings": {
"/var/www/html/": "${workspaceRoot}/item-street"
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"hostname": "::1",
"port": 9003
}
]
}
和 xdebug.ini
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.client_port=9003
xdebug.discover_client_host=1
这个xdebug配置位于/etc/php/8.0/mods-available/WSL2Ubuntu-20.04
按照这里的设置
https://github.com/felixfbecker/vscode-php-debug
但是在php代码上加断点,按f5,在chrome中访问本地php项目
什么都没发生。
我确实也阅读了以下内容
Setting up VSCode with xdebug: pathMapping
VSCode - XDebug connected to client but break points does not work
但似乎不适用于我的情况。
你知道为什么吗?
以前还可以,现在不行了
【问题讨论】: