TP接入workerman 即时通讯
首先 composer 在项目根目录安装workerman
composer require topthink/think-worker
当报错 opthink/think-worker v3.0.5 requires topthink/framework ^6.0.0 -> satisfiable by topthink/framework[6.0.x-dev, v6.0.0, v6.0.0-rc2, v6.0.0-rc3, v6.0.0-rc4, v6.0.0-rc5, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.0.5] but these conflict with your requirements or minimum-stability.
说明你的tp版本太旧 composer 默认安装的是最新版的 所以要指定一下安装版本 查看适配那个版本地址:
https://packagist.org/packages/topthink/think-worker#v2.0.8 红框处 tp版本号
composer require topthink/think-worker=2.0*
安装成功后 启动
php think worker
这个时候会如果有出现 类似报错
pcntl_alarm() has been disabled for security reasons in file **/vendor/workerman/workerman/Lib/Timer.php on line 177
是当前php配置文件 禁用了pcntl函数 去配置文件搜索pcntl开头的函数 删掉对应的报错函数就可以 我这边好像删掉四个
启动成功