Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Xdebug没有';t在VSCode上使用docker在断点上停止_Php_Docker_Visual Studio Code_Xdebug - Fatal编程技术网

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
        }
    ]
}