Php Xdebug没有';t在VSCode上使用docker在断点上停止
我已经用这个Php Xdebug没有';t在VSCode上使用docker在断点上停止,php,docker,visual-studio-code,xdebug,Php,Docker,Visual Studio Code,Xdebug,我已经用这个Dockerfile FROM php:7.3.28-apache-buster RUN pecl install xdebug-2.8.1 \ && docker-php-ext-enable xdebug COPY . /var/www/html WORKDIR /usr/src/myapp 然后我写了这个docker compose.yml 五 容器运行正常,xdebug扩展显示在phpinfo() 这是我正在使用的launch.json {
Dockerfile
FROM php:7.3.28-apache-buster
RUN pecl install xdebug-2.8.1 \
&& docker-php-ext-enable xdebug
COPY . /var/www/html
WORKDIR /usr/src/myapp
然后我写了这个docker compose.yml
五
容器运行正常,xdebug扩展显示在phpinfo()
这是我正在使用的launch.json
{
// 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": 9000,
"pathMappings": {
"/var/www/html": "${workspaceRoot}",
},
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
但是当我设置断点时,执行不会停止Xdebug 2不再受支持。请升级:启用xdebug日志,尝试调试并查看日志文件:它将告诉xdebug尝试连接到哪里(如果有)以及响应是什么。如果没有写入日志:1)检查文件权限,2)Xdebug在任何地方都看不到“调试我”标志。如果为#2,则尝试将其配置为尝试调试每个请求(因此无需查找“调试我”标志)。但总的来说,升级到xdebugv3后,在那里进行故障排除会更容易一些。
{
// 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": 9000,
"pathMappings": {
"/var/www/html": "${workspaceRoot}",
},
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}