每次报这个错误?
Error: Class "Workerman\Coroutine\Coroutine" not found
return [
'event_loop' => Workerman\Events\Fiber::class, // 这里配置会报错
'stop_timeout' => 2,
'pid_file' => runtime_path() . '/webman.pid',
'status_file' => runtime_path() . '/webman.status',
'stdout_file' => runtime_path() . '/logs/stdout.log',
'log_file' => runtime_path() . '/logs/workerman.log',
'max_package_size' => 10 * 1024 * 1024
];
return [
'webman' => [
'handler' => Http::class,
'listen' => 'http://0.0.0.0:274',
'count' => cpu_count() * 4,
'user' => '',
'group' => '',
'reusePort' => false,
'eventLoop' => '',//\Workerman\Events\Fiber::class,
'context' => [],
'constructor' => [
'requestClass' => Request::class,
'logger' => Log::channel('default'),
'appPath' => app_path(),
'publicPath' => public_path()
]
],
...
]
`Error: Class "Workerman\Coroutine\Coroutine" not found` in "/vendor/workerman/workerman/src/Worker.php:2651
match (Worker::$eventLoopClass) {
Swoole::class,
Swow::class,
Fiber::class => Coroutine::create($callback), // 2651 是这一行
default => (new \Fiber($callback))->start(),
};
"require": {
"php": ">=8.1",
"workerman/workerman": "~5.1",
"workerman/webman-framework": "~2.1",
"workerman/http-client": "^3.0",
"revolt/event-loop": "^1.0", //
"monolog/monolog": "^2.0",
"webman/database": "^2.1",
"webman/redis": "^2.1",
"illuminate/pagination": "^10.49",
"illuminate/events": "^10.49",
"youloge/ini": "^1.3",
"youloge/webman.validate": "^1.4"
},
一直就装了的
更新到 ^5.1.6试下,
composer require workerman/workerman ^5.1.6升级到 5.1.6 可以没报错了