composer install或composer update 或 composer require phpoffice/phpexcel 失败解决办法

就拿安装phpexcel为例在当前项目中的 composer.json 文件加入

composer    install 或composer update

 Problem 1
    - This package requires php >=5.6.0 but your PHP version (5.5.38) does not satisfy that requirement.
  Problem 2
    - topthink/framework v5.1.39 requires php >=5.6.0 -> your PHP version (5.5.38) does not satisfy that requirement.
    - topthink/framework v5.1.39 requires php >=5.6.0 -> your PHP version (5.5.38) does not satisfy that requirement.
    - topthink/framework v5.1.39 requires php >=5.6.0 -> your PHP version (5.5.38) does not satisfy that requirement.
    - Installation request for topthink/framework (locked at v5.1.39, required as 5.1.*) -> satisfiable by topthink/framework[v5.1.39].

 

删除 composer.lock 文件,重新执行 composer install,这样就能重新生成 composer.lock 文件了。

 

 Problem 1
    - This package requires php >=5.6.0 but your PHP version (5.5.38) does not satisfy that requirement.
  Problem 2
    - topthink/framework v5.1.39 requires php >=5.6.0 -> your PHP version (5.5.38) does not satisfy that requirement.
    - topthink/framework v5.1.39 requires php >=5.6.0 -> your PHP version (5.5.38) does not satisfy that requirement.
    - topthink/framework v5.1.39 requires php >=5.6.0 -> your PHP version (5.5.38) does not satisfy that requirement.
    - Installation request for topthink/framework (locked at v5.1.39, required as 5.1.*) -> satisfiable by topthink/framework[v5.1.39].

php版本不匹配,接着

composer install --ignore-platform-reqs     忽略版本匹配

或者composer update --ignore-platform-reqs

 

Downloading (failed)
Downloading (failed)    Failed to download phpoffice/phpexcel from dist: The "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/1441011fb7ecdd8cc689878f54f8b58a6805f870" file could not be downloaded: SSL: 远程主机强迫关闭了一个现有的 连接。

 

在当前项目中的 composer.json 文件的末尾自动添加镜像的配置信息(你也可以自己手工添加):

"repositories": {
    "packagist": {
        "type": "composer",
        "url": "https://packagist.phpcomposer.com"
    }
}

ok

  • 0
    点赞
  • 0
    收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:技术黑板 设计师:CSDN官方博客 返回首页
评论

打赏作者

呆呆呆呆了

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

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

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

打赏作者

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

抵扣说明:

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

余额充值