国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

webman2.1開啟協(xié)程上下文傳輸時報錯

guchen

問題描述

webman2.1 使用了swoole作為驅(qū)動
在測試協(xié)程上下文傳輸時報錯
截圖

程序代碼或配置

截圖

操作系統(tǒng)環(huán)境及workerman/webman等具體版本

截圖
composer

    "php": ">=8.1",
    "workerman/webman-framework": "^2.1",
    "monolog/monolog": "^2.0",
    "webman/console": "^2.1",
    "webman/rate-limiter": "^1.1",
    "workerman/validation": "^3.1",
    "webman/redis": "^2.1",
    "illuminate/events": "^11.43",
    "vlucas/phpdotenv": "^5.6",
    "webman/cache": "^2.1",
    "workerman/coroutine": "^1.1.3",
    "webman/database": "^2.1",
    "illuminate/pagination": "*",
    "symfony/var-dumper": "^7.2",
    "webman/log": "^2.1"
511 3 0
3個回答

walkor 打賞

發(fā)下 config/process.php

  • walkor 2025-02-19

    貼全,包括命名空間

  • guchen 2025-02-19

    use support\Log;
    use support\Request;
    use app\process\Http;

    global $argv;

    return [
    'webman' => [
    'handler' => Http::class,
    'listen' => 'http://0.0.0.0:8787',
    'count' => 2,
    'user' => '',
    'group' => '',
    'reusePort' => false,
    'eventLoop' => '',
    'context' => [],
    'constructor' => [
    'requestClass' => Request::class,
    'logger' => Log::channel('default'),
    'appPath' => app_path(),
    'publicPath' => public_path()
    ]
    ],
    'swoole' =>[
    'handler' => Http::class,
    'listen' => 'http://0.0.0.0:8888',
    'count' => 2,
    'user' => '',
    'group' => '',
    'reusePort' => false,
    'eventLoop' => Workerman\Events\Swoole::class,
    'context' => [],
    'constructor' => [
    'requestClass' => Request::class,
    'logger' => Log::channel('default'),
    'appPath' => app_path(),
    'publicPath' => public_path()
    ]
    ],
    // File update detection and automatic reload
    'monitor' => [
    'handler' => app\process\Monitor::class,
    'reloadable' => false,
    'constructor' => [
    // Monitor these directories
    'monitorDir' => array_merge([
    app_path(),
    config_path(),
    base_path() . '/process',
    base_path() . '/support',
    base_path() . '/resource',
    base_path() . '/.env',
    ], glob(base_path() . '/plugin//app'), glob(base_path() . '/plugin//config'), glob(base_path() . '/plugin/*/api')),
    // Files with these suffixes will be monitored
    'monitorExtensions' => [
    'php', 'html', 'htm', 'env'
    ],
    'options' => [
    'enable_file_monitor' => !in_array('-d', $argv) && DIRECTORY_SEPARATOR === '/',
    'enable_memory_monitor' => DIRECTORY_SEPARATOR === '/',
    ]
    ]
    ]
    ];

walkor 打賞

從報錯看是使用了錯誤的Request類,正常應(yīng)該使用support/Request。
調(diào)用棧里看到使用的是 Workerman\Protocols\Http\Request
類是在 config/process.php 里的 requestClass 指定的,可能你改了什么東西,用了錯誤的Request類。

  • guchen 2025-02-19

    檢查了一下,我控制器業(yè)務(wù)代碼里引用的就是 use support\Request;這個問題我重啟容器后又好了QWQ

  • walkor 2025-02-19

    類是在 config/process.php 里的 requestClass 指定的,可能之前配置是錯的

  • guchen 2025-02-19

    老大 應(yīng)該不是這個問題 這個情況又復(fù)現(xiàn)了 經(jīng)常出現(xiàn)這種情況

  • guchen 2025-02-19

    項目是新起的 基本只寫了幾個測試的接口

  • walkor 2025-02-19

    寫一個能穩(wěn)定復(fù)現(xiàn)的例子,打包發(fā)到我郵箱 walkor@workerman.net
    寫明重現(xiàn)步驟。主要,要能重現(xiàn)問題的例子。

guchen
Error: Call to undefined method Workerman\Protocols\Http\Request::getRealIp() in /www/apiV2/vendor/workerman/webman-framework/src/Exception/ExceptionHandler.php:68 Stack trace: #0 /www/apiV2/vendor/workerman/webman-framework/src/support/exception/Handler.php(35): Webman\Exception\ExceptionHandler->report(Object(TypeError)) #1 /www/apiV2/vendor/workerman/webman-framework/src/App.php(280): support\exception\Handler->report(Object(TypeError)) #2 /www/apiV2/vendor/workerman/webman-framework/src/App.php(354): Webman\App::exceptionResponse(Object(TypeError), Object(Workerman\Protocols\Http\Request)) #3 /www/apiV2/vendor/workerman/webman-framework/src/App.php(150): Webman\App::Webman\{closure}(Object(Workerman\Protocols\Http\Request)) #4 /www/apiV2/vendor/workerman/workerman/src/Connection/TcpConnection.php(676): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(Workerman\Protocols\Http\Request)) #5 /www/apiV2/vendor/workerman/workerman/src/Events/Swoole.php(288): Workerman\Connection\TcpConnection->baseRead(Resource id #10242) #6 [internal function]: Workerman\Events\Swoole->Workerman\Events\{closure}() #7 {main}
  • 暫無評論
??