技术饭
安装在thinkPHP5.1下报错了:Cannot use Workerman\Worker as Worker because the name is already in use
copylian
0 评论
10645 浏览
2020.03.26
在做定时任务,执行php命令:php think AutoDelOrder 的时候处理下了:Cannot use Workerman\Worker as Worker because the name is already in use,查看文件位置,看到的是 Workerman\Worker 名字已经被使用了,所以需要改成其他名称,这个算官方的一个BUG吧,希望尽快修复。
解决办法:
\vendor\topthink\think-worker\src\command\Server.php
找到
use Workerman\Worker as Worker;
修改为
use Workerman\Worker as Worker2;
同时记得把119行和126行的Worker改为Worker2
\vendor\topthink\think-worker\src\command\GatewayWorker.php
找到
use Workerman\Worker as Worker;
修改为
use Workerman\Worker as Worker3;
感谢你的支持,我会继续努力!
扫码打赏,感谢您的支持!
文明上网理性发言!