您现在的位置是:首页 > 经验记录>磨刀不误砍柴工>windows phpStudy ThinkPHP 5.1 Workerman 快速上手指南 网站首页 磨刀不误砍柴工
windows phpStudy ThinkPHP 5.1 Workerman 快速上手指南
一、安装Workerman
进入项目根目录运行命令(前提composer已经安装好)
官方教程:https://www.kancloud.cn/manual/thinkphp5_1/354134
composer require topthink/think-worker=2.0.*
二、运行
安装完扩展后,你什么都不需要做,最简单的就是直接在命令行(应用根目录下面)下执行:
php think worker
2.1 错误:错误原因:命名空间冲突
[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; 紧接着修改 75,97,108, 119 行与 126的 worker 改为 Worker2 找到目录: \vendor\topthink\think-worker\src\command\GatewayWorker.php 找到命名空间 use Workerman\Worker; 修改为: use Workerman\Worker as Worker3;
php think worker
参考:
ThinkPHP 5.1 Workerman 快速上手指南:https://www.kancloud.cn/thinkphp/think-worker/722897
ThinkPHP 5.1 Workerman 快速上手指南:https://www.jianshu.com/p/5070b9f36654
windows下TP5 workerman的安装与简单demo:https://blog.csdn.net/weixin_40870531/article/details/87939580
转载至:CSDN 我是高手高手高高手(haibo0668) https://blog.csdn.net/haibo0668/article/details/106717763
随机推荐
文章评论
未开放