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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章