我改了加速源,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.
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
讨论数量: 4

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

6年前 评论

想问问 你的问题解决了吗

6年前 评论

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=''

恢复设置

6年前 评论

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