composer报版本不匹配的解决方案

执行composer install遇到错误:Your requirements could not be resolved to an installable set of packages. 这是因为不匹配composer.json要求的版本。

D:\code\php\basecode\test\api_basecode> composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - laravel/horizon is locked to version v3.7.2 and an update of this package was not requested.
    - laravel/horizon v3.7.2 requires ext-pcntl * -> it is missing from your system. Install or enable PHP's pcntl extension.
  Problem 2
    - mongodb/mongodb is locked to version 1.6.1 and an update of this package was not requested.
    - mongodb/mongodb 1.6.1 requires ext-mongodb ^1.7 -> it is missing from your system. Install or enable PHP's mongodb extension.
  Problem 3
    - mongodb/mongodb 1.6.1 requires ext-mongodb ^1.7 -> it is missing from your system. Install or enable PHP's mongodb extension.
    - jenssegers/mongodb v3.6.4 requires mongodb/mongodb ^1.4 -> satisfiable by mongodb/mongodb[1.6.1].
    - jenssegers/mongodb is locked to version v3.6.4 and an update of this package was not requested.

To enable extensions, verify that they are enabled in your .ini files:
    - D:\BtSoft\php\74\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

提示我的PHP 7版本太高,不符合composer.json需要的版本,但是在PHP 7下应该也是可以运行的,composer可以设置忽略版本匹配,命令是:

$ composer install --ignore-platform-reqs 
 
或者
 
$ composer update --ignore-platform-reqs

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

weixin_41045487

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值