【问题标题】:Can't update/install using composer behind a corporate firewall无法在公司防火墙后面使用 composer 更新/安装
【发布时间】:2013-08-29 09:54:37
【问题描述】:

我正在尝试让 composer 在我们的服务器上工作,但我在尝试安装/更新存储库时不断遇到问题。

我已经正确配置了环境变量来实现这一切:

http_proxy=http://fastweb.int.bell.ca:8083/
ftp_proxy=ftp://fastweb.int.bell.ca:8083/
HTTP_PROXY_REQUEST_FULLURI=false

我还强制我的作曲家仅使用配置指令使用 HTTPS 协议:

"config": {
    "github-protocols": ["https"]
}

我们尝试通过设置 GIT_SSL_NO_VERIFY 或更新 /etc/pki/tls/certs 中的 ca-bundle.crt 来更新帖子 SSL certificate rejected trying to access GitHub over HTTPS behind firewall 之后的 ca_bundle...

似乎没有任何效果!

这是输出,它适用于所有软件包,我尝试使用和不使用 --prefer-source 只是为了看看它是否有帮助,仍然没有......

./composer.phar update Loading composer repositories with package
information Updating dependencies (including require-dev)
    - Updating crazycodr/data-transform (dev-master 11f8499 => 2.0.2)
    Checking out 11f8499d0027468705fca72ab67acfbf8ee2e6be

[RuntimeException]   Failed to clone
https://github.com/crazycodr/data-transform.git via git, https and
http protocols, aborting.

- https://github.com/crazycodr/data-transform.git
    fatal: https://github.com/crazycodr/data-transform.git/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?

【问题讨论】:

  • 你能用那个代理设置wget https://github.com/any/github/zipfile-download 吗?你可以手动git clone repos 吗?我认为应该定义一个 HTTPS_PROXY。
  • 我明天早上去看看,谢谢你的建议

标签: php ssl github composer-php


【解决方案1】:

我确认能够在防火墙后面克隆/拉取/推送 GitHub 存储库。
除了http_proxy,你还需要https_proxy

set http_proxy=http://<login_internet>:<password_internet>@aproxy:aport
set https_proxy=http://<login_internet>:<password_internet>@aproxy:aport
set no_proxy=.company

no_proxy 部分用于避免使用公司内部的内部 url 代理)

【讨论】:

  • 做得很好
  • 请注意,no_proxy 仅适用于最近的作曲家副本。评估这部分环境变量的拉取请求已于 2013 年 8 月 11 日合并。早期版本不评估它,并且很乐意尝试使用代理来获取本地资源。
猜你喜欢
  • 1970-01-01
  • 2010-12-26
  • 1970-01-01
  • 1970-01-01
  • 2011-08-09
  • 2019-06-23
  • 2017-02-27
  • 2012-08-17
  • 2011-03-07
相关资源
最近更新 更多