【问题标题】:Composer-setup : Connection Error [ERR_CONNECTION]: Unable to connect to getcomposer.orgComposer-setup:连接错误 [ERR_CONNECTION]:无法连接到 getcomposer.org
【发布时间】:2014-09-05 07:16:53
【问题描述】:

安装composer-setup.exe时出现以下错误:

Connection Error [ERR_CONNECTION]: Unable to connect to getcomposer.org

Proxy http://proxy.mycompany.com:1234 [from Internet Settings] failed with errors:
Failed to open stream: HTTP request failed! HTTP/1.0 407 Proxy Authorization Required

Request to http://getcomposer.org/installer failed with errors:
Failed to open stream: No connection could be made because the target machine actively refused it.

我的项目环境详细信息是

  • Windows 7
  • Apache v2.2.22
  • PHP v5.4.3

php.ini:

  • 启用 php_curl
  • php_openssl 已启用

请帮助我们为 Laravel 框架安装 Composer-Setup.exe

【问题讨论】:

  • 应该是“https”而不是“http”
  • 第二个错误显示“需要代理授权” - 因此正确设置代理配置似乎是一个本地问题。

标签: php laravel-4 composer-php


【解决方案1】:

环境

xampp
php 5.6.3
windows 7 64位

解决方案

  1. ca-bundle.crt保存到本地路径(例如.d:/download/ca-bundle.crt);

  2. 双击ca-bundler.crt导入;

  3. 将这两行添加到 php.ini

    curl.cainfo=d:/download/ca-bundle.crt
    openssl.cafile=d:/download/ca-bundle.crt

  4. 再次尝试安装Composer-Setup.exe

参考:https://github.com/composer/composer/issues/2798

【讨论】:

    猜你喜欢
    • 2023-03-26
    • 2014-12-01
    • 2014-02-03
    • 2013-04-16
    • 2016-12-28
    • 1970-01-01
    • 1970-01-01
    • 2022-01-24
    • 2020-08-26
    相关资源
    最近更新 更多