无法在代理后面使用composer安装laravel / socialite

时间:2015-06-26 05:54:16

标签: php laravel-5 composer-php command-line-interface windows-7-x64

我使用的是win7x64。

当我不在代理服务器后面时,我可以使用composer安装laravel,但是当我在代理服务器后面时,我无法使用composer安装任何东西。

我尝试安装laravel / socialite我收到错误:

  

在   " http://packagist.org/p/provider-2013 $ 64cefc090dc586bcea264a3e17529dfa29b16b   2bf50c52626562f13772982949.json"无法下载文件:失败   打开st ream:HTTP请求失败! http://packagist.org不能   完全加载,包信息从本地缓存加载   并且可能已经过时了

     

[Composer \ Downloader \ TransportException]   " http://packagist.org/p/laravel/socialite $ d9a828b00026fe40a14532c7f93e7   adc78725a74da02a035cd267618876c312a.json"文件不能   下载:fai导致开放流:HTTP请求失败!

     

要求[--dev] [--prefer-source] [--prefer-dist] [ - no-progress]   [--no-update] [--upate-no-dev] [--update-with-dependencies]   [--ignore-platform-reqs] [--sort- packages] [packages1] ...   [packagesN]

我有http_proxy和https_proxy env设置。

composer selfupdate正在运作

作曲家更新无效

  

使用包信息加载作曲家存储库更新   依赖(包括require-dev)   " http://packagist.org/p/provider-2013 $ 64cefc090dc586bcea264a3e17529dfa29b16b   2bf50c52626562f13772982949.json"无法下载文件:失败   打开st ream:HTTP请求失败! http://packagist.org不能   完全加载,包信息从本地缓存加载   并且可能已过期无法安装或更新生成   自动加载文件生成优化的类加载器

其他cli(例如gem)正在运作

我试过了 this solution

但它仍无效

以下是作曲家diag stat:

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: FAIL
[Composer\Downloader\TransportException] The "http://packagist.org/packages.json
" file could not be downloaded: failed to open stream: HTTP request failed!
Checking https connectivity to packagist: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: FAIL
Unable to assess the situation, maybe packagist.org is down (The "http://packagi
st.org/packages.json" file could not be downloaded: failed to open stream: HTTP
request failed! )
Checking HTTPS proxy support for request_fulluri: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK

我错过了任何设置吗?

1 个答案:

答案 0 :(得分:3)

我将它添加到composer.json

"repositories": [
    {
        "packagist": false
    },
    {
        "type": "composer",
        "url": "https://packagist.org/"
    }
],

此解决方案来自: https://github.com/composer/composer/issues/1992