阿里云centos7用composer install出问题

问题描述

阿里云服务器用composer install出问题,

问题出现的平台版本及自己尝试过哪些方法

框架是laravel框架,本地测试是没得问题的,但是服务器上就出问题了

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)图片描述
阅读 11.5k
5 个回答

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

我本地是可以安装的,虽然也耗费了大量的时间。在阿里云服务器中间会报超时,设置国内镜像也没用,试了不下五六次。

最后,我是把本地的 composer 镜像缓存复制到服务器解压到服务器对应的 composer 缓存目录,然后删除 /vendorcomposer.lock 重新 composer install 最后成功了,也很耗时 不确定是运气问题还是真的有作用,实在没办法可以一试。

同样的问题,本地也遇到了,时好时坏,不知道楼上的老兄怎么解决的!

新手上路,请多包涵

删除vendor文件夹和composer.lock,重新composer install即可

新手上路,请多包涵

直接用composer update

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏