tp5.1 运行workerman时出现 Cannot use Workerman\Worker as Worker because the name is already in use

错误原因:命名空间冲突

[think\exception\ErrorException]                                          
Cannot use Workerman\Worker as Worker because the name is already in use

解决办法:

找到目录:
\vendor\topthink\think-worker\src\command\Server.php

找到命名空间:
use Workerman\Worker;
修改为:
use Workerman\Worker as Worker2;
紧接着修改 119 行与 126的 worker 改为 Worker2


找到目录:
\vendor\topthink\think-worker\src\command\GatewayWorker.php

找到命名空间
use Workerman\Worker;
修改为:
use Workerman\Worker as Worker3;



使用已安装拓展的php-cli执行启动命令
---- complate !!!

 

你可能感兴趣的:(workman)