swoole / yasd

Yet Another Swoole Debugger
https://huanghantao.github.io/yasd-wiki/
Apache License 2.0
357 stars 35 forks source link

VS Code docker 环境 yasd #192

Closed phpxianyu closed 5 months ago

phpxianyu commented 5 months ago

dockerfile安装文档 通过 docker run 启了个 hyperf 的容器,通过 VS Code 的 debug 连接 hyperf 容器的 yasd 的端口,一直连不上,什么反应都没有,老的项目升级 php 8 以上的版本推不下去,还是希望在 php 7.4 用上这个功能 @huanghantao

huanghantao commented 5 months ago

看一看你的vscode debug扩展日志

phpxianyu commented 5 months ago

vscode debug扩展日志

launch.json 跟 log

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "log": true,
            "pathMappings": {
                "/Users/michael/Desktop/workspace/honjo/honjo_hyperf":"${workspaceFolder}"
            }
        }
    ]
}
-> setExceptionBreakpointsRequest
{ command: 'setExceptionBreakpoints',
  arguments: { filters: [] },
  type: 'request',
  seq: 5 }

<- setExceptionBreakpointsResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 5,
  command: 'setExceptionBreakpoints',
  success: true,
  body: { breakpoints: [] } }

-> configurationDoneRequest
{ command: 'configurationDone', type: 'request', seq: 6 }

<- configurationDoneResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 6,
  command: 'configurationDone',
  success: true }

-> threadsRequest
{ command: 'threads', type: 'request', seq: 7 }

<- threadsResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 7,
  command: 'threads',
  success: true,
  body: { threads: [] } }
phpxianyu commented 5 months ago

yasd 报错信息,信息出来了 vscode 没展示出来,像是版本对不上导致的 @huanghantao

php -v
PHP 7.4.22 (cli) (built: Jul 29 2021 23:51:05) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.22, Copyright (c), by Zend Technologies
    with Yasd v0.3.9-alpha, Our Copyright, by codinghuang
{
  "init": {
    "-xmlns": "urn:debugger_protocol_v1",
    "-xmlns:xdebug": "https://xdebug.org/dbgp/xdebug",
    "-fileuri": "file:///data/project/bin/hyperf.php",
    "-language": "PHP",
    "-xdebug:language_version": "7.4.22",
    "-protocol_version": "1.0",
    "-appid": "165",
    "-idekey": "hantaohuang",
    "parsererror": {
      "-style": "display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black",
      "h3": [
        "This page contains the following errors:",
        "Below is a rendering of the page up to the first error."
      ],
      "div": {
        "-style": "font-family:monospace;font-size:12px",
        "#text": "error on line 2 at column 1: Extra content at the end of the document\n"
      }
    },
    "engine": {
      "-version": "0.3.9-alpha",
      "#cdata-section": "Yasd"
    },
    "author": "Codinghuang",
    "url": "https://github.com/swoole/yasd",
    "copyright": "Copyright (c) 2020-2021 by Codinghuang"
  }
}