gpt4 book ai didi

php - Visual Studio Code PHP Debug不会在Docker项目的断点处停止

转载 作者:行者123 更新时间:2023-12-02 19:29:30 25 4
gpt4 key购买 nike

我无法使VS Code扩展“Php debug”在任何断点处停止。我正在Ubuntu笔记本电脑上从Docker运行php项目(我想调试)。任何建议,不胜感激。

我的设置:

  • Docker上的PHP版本:7.1
  • Docker上的XDebug版本:2.6.1
  • VS Code中的PHP调试版本(在我的笔记本电脑上):1.12.6

  • 我的VS Code launch.json文件是:
    {
    "version": "0.2.0",
    "configurations": [
    {
    "name": "Listen for XDebug",
    "type": "php",
    "request": "launch",
    "port": 9000,
    "log": true,
    "pathMappings": {
    "/var/www/html": "/home/chris/my-test-debugging-project"
    }
    },
    {
    "name": "Launch currently open script",
    "type": "php",
    "request": "launch",
    "program": "${file}",
    "cwd": "${fileDirname}",
    "port": 9000
    }
    ]
    }

    我的/usr/local/etc/php/conf.d/xdebug.ini配置为:
    zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
    xdebug.remote_enable=1
    xdebug.remote_autostart=1
    xdebug.remote_host=172.17.0.2
    xdebug.remote_log=/var/www/html/xdebug.log
    xdebug.remote_connect_back=0
    xdebug.remote_port=9000

    XDebug日志文件(来自在php.ini中设置xdebug.remote_log):
        Log opened at 2018-10-14 05:47:16
    I: Connecting to configured address/port: 172.17.0.2:9000.
    W: Creating socket for '172.17.0.2:9000', poll success, but error: Operation now in progress (29).
    E: Could not connect to client. :-(
    Log closed at 2018-10-

    14 05:47:16

    PHP调试日志输出(通过设置“log”:launch.json中的true):
    <- launchResponse
    Response {
    seq: 0,
    type: 'response',
    request_seq: 2,
    command: 'launch',
    success: true }

    最佳答案

    尝试设置xdebug.remote_connect_back=1,让我知道是否可行。

    如果是这样,我们可能应该关闭该问题,作为that I previously answered问题的副本。

    关于php - Visual Studio Code PHP Debug不会在Docker项目的断点处停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52834240/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com