TP5.1使用官方文档安装workerman的坑
坑1:conposer安装失败
解决方法:TP5.1需要安装wm2.0以上,不再需要workerman-for-win;
坑2:安装完成,按照官方手册,在命令行运行php think worker报错:
Cannot use Workerman\Worker as Worker because the name is already in use
解决:去vendor\topthink\think-worker\src\command\Server.php里面修改:
use Workerman\Worker as Worker2;
97行:Worker2
108行:Worker2
119和126:Worker2
坑3:运行php think worker:server报错:
Call to undefined method think\worker\command\Worker::runAll()
解决:75行:Worker2:!!!!
最后:还要主要要去php-ini里面吧一个 什么 file 扩展开启,如果没报错就阔以啦
谨以此,纪念我浪费的2天。。。。。。。。