在运行 composer install时 报相关扩展的错误,错误如下: Problem 1 - laravel/horizon[v4.3.0, ..., 4.x-dev] require ext-pcntl * -> it is
在运行 composer install时
报相关扩展的错误,错误如下:
Problem 1 - laravel/horizon[v4.3.0, ..., 4.x-dev] require ext-pcntl * -> it is missing from your system. Install or enable PHP's pcntl extension. - Root composer.json requires laravel/horizon ^4.3 -> satisfiable by laravel/horizon[v4.3.0, ..., 4.x-dev].To enable extensions, verify that they are enabled in your .ini files: - D:\PHPstudy\phpstudy_pro\Extensions\php\php7.3.4nts\php.iniYou can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
由于 Horizon 需要 php 的 pcntl 扩展,而 win 环境无法安装该扩展,导致无法成功安装 Horizon,进而导致本地环境无法使用,artisan 命令无法使用。
解决办法:
windows 环境安装 Horizon 报错解决:
composer install/update --ignore-platfORM-reqs
composer install –ignore-platform-reqs 就相当于设置了忽略版本匹配。如果方法1不行可以使用方法2
打开composer.JSON
文件,添加如下配置
"config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true, "platform": { "ext-pcntl": "7.2", "ext-posix": "7.2" }},
重新运行
composer install
我使用方法2 成功 解决错误,方法1没有使用过。用过的可以反馈
参考:https://www.ziruchu.com/art/349 https://learnku.com/articles/29150
--结束END--
本文标题: 报错: Install or enable PHP‘s pcntl extension.的解决方法
本文链接: https://www.lsjlt.com/news/388622.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0