首页
下载
文档
问答社区
视频
捐赠
源代码
AI 助理
赞助商
CRMEB
Apipost
腾讯云
微擎
禅道
51Talk
商业产品
Swoole AI 智能文档翻译器
Swoole-Compiler PHP 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
PHP7.4 升级hyperf2.2启动报错
### 问题描述 ```bash [root@localhost hall-activity]# php -d swoole.use_shortname=Off bin/hyperf.php start PHP Fatal error: Uncaught Error: Call to undefined function Hyperf\Di\Annotation\pcntl_fork() in /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/Annotation/Scanner.php:120 Stack trace: #0 /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/ClassLoader.php(52): Hyperf\Di\Annotation\Scanner->scan() #1 /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/ClassLoader.php(87): Hyperf\Di\ClassLoader->__construct() #2 /mnt/hgfs/VMShare/web/hall-activity/bin/hyperf.php(18): Hyperf\Di\ClassLoader::init() #3 /mnt/hgfs/VMShare/web/hall-activity/bin/hyperf.php(24): {closure}() #4 {main} thrown in /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/Annotation/Scanner.php on line 120 Fatal error: Uncaught Error: Call to undefined function Hyperf\Di\Annotation\pcntl_fork() in /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/Annotation/Scanner.php:120 Stack trace: #0 /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/ClassLoader.php(52): Hyperf\Di\Annotation\Scanner->scan() #1 /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/ClassLoader.php(87): Hyperf\Di\ClassLoader->__construct() #2 /mnt/hgfs/VMShare/web/hall-activity/bin/hyperf.php(18): Hyperf\Di\ClassLoader::init() #3 /mnt/hgfs/VMShare/web/hall-activity/bin/hyperf.php(24): {closure}() #4 {main} thrown in /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/Annotation/Scanner.php on line 120 ``` ### Swoole版本,PHP版本,以及操作系统版本信息 ![](/storage/article-column/EeJTZvU29XVkoQV72TOj29cJthbvrvrk5ysd4cGB.png) ![](/storage/article-column/YmynbHhZEyqgrbbxNcoSwzoZe6v2VZRKsITpcKbQ.png) ```bash [root@localhost hall-activity]# php -m [PHP Modules] bcmath bz2 calendar Core ctype curl date dba dom exif fileinfo filter ftp gettext gmp hash iconv intl json libxml mbstring mysqli mysqlnd openssl pcre PDO pdo_mysql pdo_sqlite Phar posix readline redis Reflection session shmop SimpleXML soap sockets SPL sqlite3 standard swoole sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlrpc xmlwriter xsl zip zlib [Zend Modules] composer信息 ```php { "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", "ext-json": "*", "96qbhy/hyperf-auth": "^2.3", "firebase/php-jwt": "^5.3", "hyperf/async-queue": "^2.2", "hyperf/cache": "^2.2", "hyperf/command": "~2.2.0", "hyperf/config": "~2.2.0", "hyperf/constants": "^2.2", "hyperf/crontab": "^2.2", "hyperf/database": "~2.2.0", "hyperf/db-connection": "~2.2.0", "hyperf/filesystem": "^2.2", "hyperf/framework": "~2.2.0", "hyperf/guzzle": "^2.2", "hyperf/http-server": "~2.2.0", "hyperf/logger": "~2.2.0", "hyperf/memory": "~2.2.0", "hyperf/process": "~2.2.0", "hyperf/redis": "^2.2", "hyperf/socketio-server": "^2.2", "hyperf/validation": "^2.2", "hyperf/websocket-server": "^2.2", "overtrue/flysystem-qiniu": "^1.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.14", "hyperf/devtool": "~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-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": [ "app/Common/Helper/Helper.php" ] }, "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 -c phpunit.xml --prepend test/bootstrap.php --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" ] } } ``` ``` ### 相关代码 ```php 请将代码粘贴至此处(请勿用截图) ``` ### 你期待的结果是什么?实际看到的错误信息又是什么? 已经删除composer.lock,vender文件夹 重新安装 我是在虚拟机跑的,系统:CentOS Linux release 7.9.2009 (Core)
发布于3年前 · 38 次浏览 · 来自
提问
neo_chen
### 问题描述 ```bash [root@localhost hall-activity]# php -d swoole.use_shortname=Off bin/hyperf.php start PHP Fatal error: Uncaught Error: Call to undefined function Hyperf\Di\Annotation\pcntl_fork() in /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/Annotation/Scanner.php:120 Stack trace: #0 /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/ClassLoader.php(52): Hyperf\Di\Annotation\Scanner->scan() #1 /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/ClassLoader.php(87): Hyperf\Di\ClassLoader->__construct() #2 /mnt/hgfs/VMShare/web/hall-activity/bin/hyperf.php(18): Hyperf\Di\ClassLoader::init() #3 /mnt/hgfs/VMShare/web/hall-activity/bin/hyperf.php(24): {closure}() #4 {main} thrown in /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/Annotation/Scanner.php on line 120 Fatal error: Uncaught Error: Call to undefined function Hyperf\Di\Annotation\pcntl_fork() in /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/Annotation/Scanner.php:120 Stack trace: #0 /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/ClassLoader.php(52): Hyperf\Di\Annotation\Scanner->scan() #1 /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/ClassLoader.php(87): Hyperf\Di\ClassLoader->__construct() #2 /mnt/hgfs/VMShare/web/hall-activity/bin/hyperf.php(18): Hyperf\Di\ClassLoader::init() #3 /mnt/hgfs/VMShare/web/hall-activity/bin/hyperf.php(24): {closure}() #4 {main} thrown in /mnt/hgfs/VMShare/web/hall-activity/vendor/hyperf/di/src/Annotation/Scanner.php on line 120 ``` ### Swoole版本,PHP版本,以及操作系统版本信息 ![](/storage/article-column/EeJTZvU29XVkoQV72TOj29cJthbvrvrk5ysd4cGB.png) ![](/storage/article-column/YmynbHhZEyqgrbbxNcoSwzoZe6v2VZRKsITpcKbQ.png) ```bash [root@localhost hall-activity]# php -m [PHP Modules] bcmath bz2 calendar Core ctype curl date dba dom exif fileinfo filter ftp gettext gmp hash iconv intl json libxml mbstring mysqli mysqlnd openssl pcre PDO pdo_mysql pdo_sqlite Phar posix readline redis Reflection session shmop SimpleXML soap sockets SPL sqlite3 standard swoole sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlrpc xmlwriter xsl zip zlib [Zend Modules] composer信息 ```php { "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", "ext-json": "*", "96qbhy/hyperf-auth": "^2.3", "firebase/php-jwt": "^5.3", "hyperf/async-queue": "^2.2", "hyperf/cache": "^2.2", "hyperf/command": "~2.2.0", "hyperf/config": "~2.2.0", "hyperf/constants": "^2.2", "hyperf/crontab": "^2.2", "hyperf/database": "~2.2.0", "hyperf/db-connection": "~2.2.0", "hyperf/filesystem": "^2.2", "hyperf/framework": "~2.2.0", "hyperf/guzzle": "^2.2", "hyperf/http-server": "~2.2.0", "hyperf/logger": "~2.2.0", "hyperf/memory": "~2.2.0", "hyperf/process": "~2.2.0", "hyperf/redis": "^2.2", "hyperf/socketio-server": "^2.2", "hyperf/validation": "^2.2", "hyperf/websocket-server": "^2.2", "overtrue/flysystem-qiniu": "^1.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.14", "hyperf/devtool": "~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-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": [ "app/Common/Helper/Helper.php" ] }, "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 -c phpunit.xml --prepend test/bootstrap.php --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" ] } } ``` ``` ### 相关代码 ```php 请将代码粘贴至此处(请勿用截图) ``` ### 你期待的结果是什么?实际看到的错误信息又是什么? 已经删除composer.lock,vender文件夹 重新安装 我是在虚拟机跑的,系统:CentOS Linux release 7.9.2009 (Core)
赞
0
分享
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
评论
2021-07-20
鲁飞
缺少`pcntl`扩展。
赞
1
回复
2021-07-20
neo_chen
回复
鲁飞
已OK!
赞
0
回复
微信公众号
热门内容
暂无回复的问答
- CodeGalaxy K3s 轻量集群节点之间如何实现负载均衡
- 关于openssl CURL WARNING swSSL_connect: SSL_connect(fd=69) failed. Error: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small[1|394]
- 多个模型如何进行事务异常回退?
- websocket开启wss报错
- 协程tcp服务器如何使用多进程?recv()方法接收信息,打印出来的pid一直是同一个。没用使用到多进程啊。