php - 无法使用代理后面的 Composer 安装 laravel/socialite

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

我使用的是 win7x64。

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

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

The "http://packagist.org/p/provider-2013$64cefc090dc586bcea264a3e17529dfa29b16b 2bf50c52626562f13772982949.json" file could not be downloaded: failed to open st ream: HTTP request failed! http://packagist.org could not be fully loaded, package information was loaded f rom the local cache and may be out of date

[Composer\Downloader\TransportException] The "http://packagist.org/p/laravel/socialite$d9a828b00026fe40a14532c7f93e7 adc78725a74da02a035cd267618876c312a.json" file could not be downloaded: fai led to open stream: HTTP request failed!

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

我有 http_proxy 和 https_proxy 环境设置。

Composer self 更新正在工作

但是

Composer 更新不工作

Loading composer repositories with package information Updating dependencies (including require-dev) The "http://packagist.org/p/provider-2013$64cefc090dc586bcea264a3e17529dfa29b16b 2bf50c52626562f13772982949.json" file could not be downloaded: failed to open st ream: HTTP request failed! http://packagist.org could not be fully loaded, package information was loaded f rom the local cache and may be out of date Nothing to install or update Generating autoload files Generating optimized class loader

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

我试过了 this solution

还是不行

这里是 Composer 诊断统计:

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

我是否遗漏了任何设置?

最佳答案

我将其添加到 composer.json

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

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

关于php - 无法使用代理后面的 Composer 安装 laravel/socialite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31065888/

相关文章:

laravel-5 - 如何在 Laravel Blade 中定义一个变量

php - 如何在adobe echosign文档中设置签名占位符的位置

php - 将数据库连接/对象放入 PHP 函数中的最佳方法是什么?

php - 如何在Laravel 5中从请求中检索url参数?

docker - Docker返回了一个非零代码:安装 Composer 时为28

php - 安全威胁-composer/installed.json

composer-php - 我如何使用 Composer 安装没有版本的包(仅限 master)

javascript - 将 javascript 数组发送到 SQL,然后将信息返回到 HTML

php - sqlite 和窗口 : Not enough storage is available to complete this operation and CoInitialize has not been called

php - 我如何使用点语法遍历 laravel 中的模型关系