V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
xbdsky
V2EX  ›  问与答

cmf-swoole PHP think swoole 启动报错?要如何处理?

  •  
  •   xbdsky · 2019-10-30 16:00:20 +08:00 · 1843 次点击
    这是一个创建于 1612 天前的主题,其中的信息可能已经有所发展或是发生改变。

    PHP Fatal error: Swoole\Coroutine\Channel::__construct(): Unable to use async-io in task processes, please set task_async to true. in /www/wwwroot/xxxx/vendor/thinkcmf/cmf-swoole/src/Http.php on line 141

    Fatal error: Swoole\Coroutine\Channel::__construct(): Unable to use async-io in task processes, please set task_async to true. in /www/wwwroot/xxxx/vendor/thinkcmf/cmf-swoole/src/Http.php on line 141

    官方文档 https://wiki.swoole.com/wiki/page/1014.html

    php7.3.1 Nginx1.15.8

    php --ri swoole swoole support => enabled Version => 4.2.10 Author => Swoole Group[email: [email protected]] coroutine => enabled epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled spinlock => enabled rwlock => enabled sockets => enabled openssl => OpenSSL 1.0.2l 25 May 2017 pcre => enabled zlib => enabled mutex_timedlock => enabled pthread_barrier => enabled futex => enabled async_redis => enabled

    Directive => Local Value => Master Value swoole.enable_coroutine => On => On swoole.aio_thread_num => 2 => 2 swoole.display_errors => On => On swoole.use_shortname => On => On swoole.fast_serialize => Off => Off swoole.unixsock_buffer_size => 8388608 => 8388608

    配置

    刚接触不知道如何处理?

    1 条回复    2019-10-30 16:15:37 +08:00
    haiyang416
        1
    haiyang416  
       2019-10-30 16:15:37 +08:00
    错误提示很明白了,不要在 Task 进程里使用协程有关的代码。
    要么根据它的提示开启 Task 进程的协程支持,要么修改 Task 任务代码,把协程部分删除。
    看了下 task_async 的相关文档,这参数会导致很多问题,所以你还是修改 Task 任务代码吧。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5453 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 08:50 · PVG 16:50 · LAX 01:50 · JFK 04:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.