加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

laravel集成workerman,使用异步mysql,redis组件时,报错EventB

发布时间:2020-12-14 19:57:34 所属栏目:大数据 来源:网络整理
导读:由于laravel项目中集成了workerman,因业务需要,需要使用异步的mysql和redis组件。 composer require react/mysqlcomposer require clue/redis-react 安装完成后,直接导致workerman无法启动,并报错。 EventException : EventBase cannot be constructed w

由于laravel项目中集成了workerman,因业务需要,需要使用异步的mysql和redis组件。

composer require react/mysql
composer require clue/redis-react

安装完成后,直接导致workerman无法启动,并报错。

EventException  : EventBase cannot be constructed with the provided configura
tion. Make sure that the specified features are supported on the current platform.

然后一顿百度,google,发现在github上有人已经提交了bug。

https://github.com/reactphp/event-loop/pull/192

说明在windows下不支持?EventBaseConfig::FEATURE_FDS。

?

解决方法:

在 vendor/react/event-loop/src/ExtEventLoop.php 文件 48 行,加上判断。

if ('WIN' !== strtoupper(substr(PHP_OS,3))) {
    $config->requireFeatures(EventBaseConfig::FEATURE_FDS);
}

  

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读