thinkphp启动workerman,报错:Class ‘think\Console’ not found

thinkphp启动workerman,报错:Class 'think\Console' not found

如何解决呢?

很简单,只要找到/vendor/topthink/think-worker/src/command.php这个文件,在里面加上下面这行代码

require_once __DIR__.'/../../../../thinkphp/library/think/Console.php';

其实出现这个问题的原因是:在workerman环境下,think\Console这个类无法自动加载,所以我们可以手动将这个类require进来。

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: