新项目【webman+gatewayworker】报错

sanye

问题描述

webman+gatewayworker报错

按照【 https://www.workerman.net/doc/gateway-worker/webman.html 】的步骤先创建webman项目,再进入后require gatewaorker 后启动,但是报如下的错

ArgumentCountError: Too few arguments to function Webman\GatewayWorker\Register::__construct(), 0 passed in /www/wwwroot/scnet/vendor/workerman/webman-framework/src/Container.php on line 70 and exactly 1 expected in /www/wwwroot/scnet/vendor/webman/gateway-worker/src/Register.php:6

为此你搜索到了哪些方案及不适用的原因

服务器是centos7.9,php version 是8.0

456 2 1
2个回答

sanye
ArgumentCountError: Too few arguments to function Webman\GatewayWorker\Register::__construct(), 0 passed in /www/wwwroot/scnet/vendor/workerman/webman-framework/src/Container.php on line 70 and exactly 1 expected in /www/wwwroot/scnet/vendor/webman/gateway-worker/src/Register.php:6
Stack trace:
#0 /www/wwwroot/scnet/vendor/workerman/webman-framework/src/Container.php(70): Webman\GatewayWorker\Register->__construct()
#1 /www/wwwroot/scnet/vendor/workerman/webman-framework/src/support/Container.php(46): Webman\Container->make()
#2 /www/wwwroot/scnet/support/helpers.php(468): support\Container::__callStatic()
#3 /www/wwwroot/scnet/vendor/workerman/workerman/Worker.php(2488): {closure}()
#4 /www/wwwroot/scnet/vendor/workerman/workerman/Worker.php(1627): Workerman\Worker->run()
#5 /www/wwwroot/scnet/vendor/workerman/workerman/Worker.php(1423): Workerman\Worker::forkOneWorkerForLinux()
#6 /www/wwwroot/scnet/vendor/workerman/workerman/Worker.php(1397): Workerman\Worker::forkWorkersForLinux()
#7 /www/wwwroot/scnet/vendor/workerman/workerman/Worker.php(560): Workerman\Worker::forkWorkers()
#8 /www/wwwroot/scnet/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()
#9 /www/wwwroot/scnet/start.php(4): support\App::run()
#10 {main}
worker[plugin.webman.gateway-worker.register:26024] exit with status 64000
  • sanye 2023-07-20

    一行代码都没有写,就创建webman后引入gateworker之后就这样,

walkor

升级下

composer require webman/gateway-worker ^v1.0.8
  • sanye 2023-07-20

    已验证,OK不报错了,麻烦更新一下文档

🔝