鍍金池/ 問答/PHP  Linux/ 阿里云centos7用composer install出問題

阿里云centos7用composer install出問題

問題描述

阿里云服務(wù)器用composer install出問題,

問題出現(xiàn)的平臺版本及自己嘗試過哪些方法

框架是laravel框架,本地測試是沒得問題的,但是服務(wù)器上就出問題了

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 51 installs, 0 updates, 0 removals

  • Installing ramsey/uuid (3.7.3): Downloading (failed) Failed to download ramsey/uuid from dist: The "https://files.phpcomposer.com/files/ramsey/uuid/44abcdad877d9a46685a3a4d221e3b2c4b87cb76.zip" file could not be downloaded (HTTP/1.1 405 Not Allowed)
    Now trying to download from source
  • Installing ramsey/uuid (3.7.3): Cloning 44abcdad87
  • Installing psr/simple-cache (1.0.1): Downloading (failed) Failed to download psr/simple-cache from dist: The "https://files.phpcomposer.com/files/php-fig/simple-cache/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b.zip" file could not be downloaded (HTTP/1.1 405 Not Allowed)
    Now trying to download from source
  • Installing psr/simple-cache (1.0.1): Cloning 408d5eafb8
  • Installing psr/container (1.0.0): Downloading (failed) Failed to download psr/container from dist: The "https://files.phpcomposer.com/files/php-fig/container/b7ce3b176482dbbc1245ebf52b181af44c2cf55f.zip" file could not be downloaded (HTTP/1.1 405 Not Allowed)
    Now trying to download from source
  • Installing psr/container (1.0.0): Cloning b7ce3b1764
  • Installing symfony/translation (v4.1.1): Downloading (failed) Failed to download symfony/translation from dist: The "https://files.phpcomposer.com/files/symfony/translation/b6d8164085ee0b6debcd1b7a131fd6f63bb04854.zip" file could not be downloaded (HTTP/1.1 405 Not Allowed)
    Now trying to download from source
  • Installing symfony/translation (v4.1.1): Cloning b6d8164085
  • Installing nesbot/carbon (1.31.1): Downloading (failed) Failed to download nesbot/carbon from dist: The "https://files.phpcomposer.com/files/briannesbitt/Carbon/385780c8ca2dbfd25452666e3f55e8dc1df58c41.zip" file could not be downloaded (HTTP/1.1 405 Not Allowed)圖片描述
回答
編輯回答
扯不斷

刪除vendor文件夾和composer.lock,重新composer install即可

2017年3月11日 08:31
編輯回答
青裙

同樣的問題,本地也遇到了,時好時壞,不知道樓上的老兄怎么解決的!

2017年3月7日 20:30
編輯回答
陪妳哭

應(yīng)該是鏡像問題,https://pkg.phpcomposer.com/...

2017年5月14日 07:10
編輯回答
鐧簞噯

提供一下我自己的方案吧。

我本地是可以安裝的,雖然也耗費了大量的時間。在阿里云服務(wù)器中間會報超時,設(shè)置國內(nèi)鏡像也沒用,試了不下五六次。

最后,我是把本地的 composer 鏡像緩存復(fù)制到服務(wù)器解壓到服務(wù)器對應(yīng)的 composer 緩存目錄,然后刪除 /vendorcomposer.lock 重新 composer install 最后成功了,也很耗時 不確定是運氣問題還是真的有作用,實在沒辦法可以一試。

2017年1月23日 07:11