swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 786 forks source link

提示 API must be called in the coroutine #790

Closed suhanyujie closed 5 years ago

suhanyujie commented 5 years ago
Q A
Bug report? yes
Feature request? no
Swoft version 2.x
Swoole version 4.4
PHP version 7.3
Runtime environment CentOS 7

Details

Uncaught Swoole\Error: API must be called in the coroutine invendor/swoft/stdlib/\src/Helper/SystemHelper.php:72

通过 composer 方式安装的 swoft composer create-project swoft/swoft swoft

suhanyujie commented 5 years ago

在 qq 群里问了。通过切换到 swoole 4.3 可以解决。

EPsheep commented 5 years ago

swoft2.0.3至2.0.5, ./bin/swoft注释掉 \Swoole\Runtime::enableCoroutine(); 这段代码也可以解决

suhanyujie commented 5 years ago

swoft2.0.3至2.0.5, ./bin/swoft注释掉 \Swoole\Runtime::enableCoroutine(); 这段代码也可以解决

感觉你这个方法更靠谱点

goforwork commented 3 years ago

swoft2.0.3至2.0.5, ./bin/swoft注释掉 \Swoole\Runtime::enableCoroutine(); 这段代码也可以解决

感觉你这个方法更靠谱点

可是这样不就关了携程环境吗?