想使用框架的小白请教 ERROR php_swoole_server_rshutdown() (ERRNO 503): Fatal error: Swoole\Coroutine::create(): Unable to use async-io in task processes, please set task_enable_coroutine to true in /data/hyperf2.2/hyperf-skeleton/vendor/hyperf/engine #4542
Unanswered
dabaituiciliu
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
我刚composer 安装完框架 只是配置了config_center
然后设置了 Constant::OPTION_TASK_ENABLE_COROUTINE => false,框架一直报错 修改为true 或者禁用 CONFIG_CENTER 就正常启动了
请问我在Constant::OPTION_TASK_ENABLE_COROUTINE => false 的情况下 如何修改才能让项目正常启动? 我如何找到是哪个进程在启动中导致如下报错?
错误信息如下
[2022-02-17 09:56:07 ^2697.7] ERROR php_swoole_server_rshutdown() (ERRNO 503): Fatal error: Swoole\Coroutine::create(): Unable to use async-io in task processes, please set
task_enable_coroutine
to true in /data/hyperf2.2/hyperf-skeleton/vendor/hyperf/engine/src/Coroutine.php on line 47PHP Fatal error: Swoole\Coroutine::create(): Unable to use async-io in task processes, please set
task_enable_coroutine
to true in /data/hyperf2.2/hyperf-skeleton/vendor/hyperf/engine/src/Coroutine.php on line 47Fatal error: Swoole\Coroutine::create(): Unable to use async-io in task processes, please set
task_enable_coroutine
to true in /data/hyperf2.2/hyperf-skeleton/vendor/hyperf/engine/src/Coroutine.php on line 47docker环境是文档中的
docker run --name hyperf
-v /workspace/skeleton:/data/project
-p 9501:9501 -it
--privileged -u root
--entrypoint /bin/sh
hyperf/hyperf:7.4-alpine-v3.11-swoole
composer.json内容为
{
"name": "hyperf/hyperf-skeleton",
"type": "project",
"keywords": [
"php",
"swoole",
"framework",
"hyperf",
"microservice",
"middleware"
],
"description": "A coroutine framework that focuses on hyperspeed and flexible, specifically use for build microservices and middlewares.",
"license": "Apache-2.0",
"require": {
"php": ">=7.3",
"hyperf/cache": "~2.2.0",
"hyperf/command": "~2.2.0",
"hyperf/config": "~2.2.0",
"hyperf/db-connection": "~2.2.0",
"hyperf/framework": "~2.2.0",
"hyperf/guzzle": "~2.2.0",
"hyperf/http-server": "~2.2.0",
"hyperf/logger": "~2.2.0",
"hyperf/memory": "~2.2.0",
"hyperf/process": "~2.2.0",
"hyperf/database": "~2.2.0",
"hyperf/redis": "~2.2.0",
"hyperf/json-rpc": "~2.2.0",
"hyperf/rpc": "~2.2.0",
"hyperf/rpc-client": "~2.2.0",
"hyperf/rpc-server": "~2.2.0",
"hyperf/config-apollo": "~2.2.0",
"hyperf/constants": "~2.2.0",
"hyperf/async-queue": "~2.2.0",
"hyperf/amqp": "~2.2.0",
"hyperf/model-cache": "~2.2.0",
"hyperf/elasticsearch": "~2.2.0",
"hyperf/tracer": "~2.2.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"hyperf/devtool": "~2.2.0",
"hyperf/ide-helper": "~2.2.0",
"hyperf/testing": "~2.2.0",
"mockery/mockery": "^1.0",
"phpstan/phpstan": "^0.12",
"swoole/ide-helper": "^4.5"
},
"suggest": {
"ext-openssl": "Required to use HTTPS.",
"ext-json": "Required to use JSON.",
"ext-pdo": "Required to use MySQL Client.",
"ext-pdo_mysql": "Required to use MySQL Client.",
"ext-redis": "Required to use Redis Client."
},
"autoload": {
"psr-4": {
"App\": "app/"
},
"files": []
},
"autoload-dev": {
"psr-4": {
"HyperfTest\": "./test/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"optimize-autoloader": true,
"sort-packages": true
},
"extra": [],
"scripts": {
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-autoload-dump": [
"rm -rf runtime/container"
],
"test": "co-phpunit --prepend test/bootstrap.php -c phpunit.xml --colors=always",
"cs-fix": "php-cs-fixer fix $1",
"analyse": "phpstan analyse --memory-limit 300M -l 0 -c phpstan.neon ./app ./config",
"start": [
"Composer\Config::disableProcessTimeout",
"php ./bin/hyperf.php start"
]
}
}
Beta Was this translation helpful? Give feedback.
All reactions