首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“无法下载https://packagist.org/packages.json”文件

“无法下载https://packagist.org/packages.json”文件
EN

Stack Overflow用户
提问于 2018-12-18 23:45:11
回答 1查看 3.5K关注 0票数 2

我想为我正在制作的Laravel聊天应用程序安装一个包。当运行"composer require foo/bar“时,我在终端中得到了以下错误:

代码语言:javascript
复制
In RemoteFilesystem.php line 515:

The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Unable to find the socket transport "proxy_user_name" - did you forget to enable it when you configured PHP?

我正在使用VPN,但它仍然引用我的代理凭据,由于VPN,代理凭据应该看不到。

在运行"composer diagnose“时,我得到了这样的结果:

代码语言:javascript
复制
Lolo@lolo:/media/lolo/project_path/project_name$ 
composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: WARNING

[Composer\Downloader\TransportException] The "http://packagist.org/packages.json" file could not be downloaded: failed to open stream: Unable to find the socket transport "foobar" - did you forget to enable it when you configured PHP?

Checking https connectivity to packagist: WARNING
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Unable to find the socket transport "foobar" - did you forget to enable it when you configured PHP?

Checking HTTP proxy: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Unable to find the socket transport "foobar" - did you forget to enable it when you configured PHP?

Checking HTTP proxy support for request_fulluri: WARNING
Unable to assess the situation, maybe packagist.org is down (The "http://packagist.org/packages.json" file could not be downloaded: failed to open stream: Unable to find the socket transport "foobar" - did you forget to enable it when you configured PHP?)

Checking HTTPS proxy support for request_fulluri: WARNING

Unable to assess the situation, maybe github is down (The "https://api.github.com/repos/Seldaek/jsonlint/zipball/1.0.0" file could not be downloaded: failed to open stream: Unable to find the socket transport "foobar" - did you forget to enable it when you configured PHP?)
Checking github.com rate limit: FAIL

[Composer\Downloader\TransportException] The "https://api.github.com/rate_limit" file could not be downloaded: failed to open stream: Unable to find the socket transport "foobar" - did you forget to enable it when you configured PHP?

Checking disk free space: OK
Composer version: 1.6.3
PHP version: 7.2.7-0ubuntu0.18.04.2
PHP binary path: /usr/bin/php7.2

导致错误的原因可能是什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-01-30 07:03:48

这是由于错误的代理配置造成的。尝试更正您的代理或使用(临时)禁用它

代码语言:javascript
复制
unset http_proxy;
unset https_proxy;

当需要通过代理时,您可以使用redsocks。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53836541

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档