【问题标题】:Composer behind proxy, set up, still not working代理后面的作曲家,设置,仍然无法正常工作
【发布时间】:2016-01-21 20:33:01
【问题描述】:

我在代理后面有带有 Ubuntu 14.04 的 VirtualBox。我已经安装了 Apache2、PHP、MySQL 和 Composer。我做了谷歌,设置了系统范围的代理,apt-get 和 git 的代理。并据此:

deralsem@DerVirtualBox:/var/www/laravel$ composer diag
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking **HTTP proxy**: OK
Checking **HTTP proxy support for request_fulluri**: OK
Checking **HTTPS proxy support for request_fulluri**: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK

Composer 设置为使用代理。但是,试试这个:

$ cd /var/www
$ git clone https://github.com/laravel/laravel.git
Navigate to Laravel code directory and use composer to install all dependencies required for Laravel framework.
$ cd /var/www/laravel
$ sudo composer install

我有这个:

Loading composer repositories with package information
[Composer\Downloader\TransportException]                                                 
  The "https://packagist.org/packages.json" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: No address associated with hostname                       
  failed to open stream: php_network_getaddresses: getaddrinfo failed: No address associated with hostname                                                                        

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [packages1] ... [packagesN]

任何建议表示赞赏。

【问题讨论】:

    标签: laravel proxy composer-php


    【解决方案1】:

    请尝试将HTTP_PROXY设置为环境变量

    export HTTP_PROXY="http://the.proxy"
    php composer.phar install
    

    也许是export HTTPS_PROXY_REQUEST_FULLURI=0

    参考:https://getcomposer.org/doc/03-cli.md#http-proxy-or-http-proxy

    (当诊断命令未正确报告环境问题时,可能是 Composer 错误。)


    错误消息php_network_getaddresses: getaddrinfo failed: No address associated with hostname 表示DNS 问题。

    似乎没有正确配置代理的 DNS 解析。

    请尝试将您的 /etc/resolv.conf 文件中的名称服务器更改为其他名称服务器,例如sudo echo "nameserver 8.8.8.8" >> /etc/resolv.conf.

    那么你可以pingPackagist 的 URL 和 IP 地址。

    请求网址(主机名):https://packagist.org/

    远程地址:87.98.253.214:443

    【讨论】:

    • 已经试过了 - 没有运气,同样的错误,没有与主机名关联的地址。
    • 这很奇怪。我认为它不是 Composer,而是代理/DNS 配置问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-18
    • 1970-01-01
    • 2017-09-06
    • 2011-03-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多