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

[已解決] webman http-client 同步返回null

lsmir2

問題描述

截圖

程序代碼或配置

    public function httptest(): string
    {
        $url='https://baidu.com';
        $http = new \Workerman\Http\Client();
        $response=$http->get($url);
        return $response->getBody()->getContents();
    }

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

macos 14.7 (23H124)

php -v
Cannot load Xdebug - it was already loaded
PHP 8.3.17 (cli) (built: Feb 21 2025 19:28:19) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.17, Copyright (c) Zend Technologies
with Xdebug v3.4.1, Copyright (c) 2002-2025, by Derick Rethans

composer
截圖

composer切到華為云進行降級
截圖
截圖

revolt/event-loop 是1.0.6 $response 是有值的
等大佬解惑..

471 1 1
1個回答

walkor 打賞

workerman 5.1開始所有協(xié)程需要手動開啟,包括Fiber。

$worker->eventLoop = Workerman\Events\Fiber::calss;
  • lsmir2 2025-02-24
    webman
    'eventLoop' => class_exists(Workerman\Events\Fiber::class) ? Workerman\Events\Fiber::class : ''
    線上 workerman 5.0.1 本地 5.1
??