我使用的是 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/"
}
],
关于php - 无法使用代理后面的 Composer 安装 laravel/socialite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31065888/