我改了加速源,Composer require 也是各种超时,有什么好的办法吗?

vagrant@homestead:~/Code/larabbs$ composer config -g repo.packagist composer https://packagist.phpcomposer.com
vagrant@homestead:~/Code/larabbs$ composer require "overtrue/laravel-lang:~3.0"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing caouecs/laravel-lang (3.0.54): Downloading (failed)
Downloading (failed)
Downloading (failed)    Failed to download caouecs/laravel-lang from dist: The "https://api.github.com/repos/caouecs/Laravel-lang/zipball/eaa1e26eb643d7fc696d410b45e55290143e1f7f" file could not be downloaded: SSL: Connection reset by peer
Failed to enable crypto
failed to open stream: operation failed
    Now trying to download from source
     - Installing caouecs/laravel-lang (3.0.54): Cloning eaa1e26eb6

  [Symfony\Component\Process\Exception\ProcessTimedOutException]
  The process "git clone --no-checkout 'https://github.com/caouecs/Laravel-lang
  .git' '/home/vagrant/Code/larabbs/vendor/caouecs/laravel-lang' && cd '/home/v
  agrant/Code/larabbs/vendor/caouecs/laravel-lang' && git remote add composer '
  https://github.com/caouecs/Laravel-lang.git' && git fetch composer" exceeded
  the timeout of 300 seconds.
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 4

github也比以前难上了很多,我还用了科学上网 :sob:

5年前 评论

想问问 你的问题解决了吗

5年前 评论

composer 要从 github 下载一些 zip 文件,详细的可以执行 composer require "overtrue/laravel-lang:~3.0" -vvv 看看。

我的解决方案是在 bash 中执行

export http_proxy='my-http-proxy-host:port'
export https_proxy='my-https-proxy-host:port'

使用代理来下载github上的文件。
记得下完了之后执行

export http_proxy=''
export https_proxy=''

恢复设置

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!