Composer php 编写器安装或更新引发异常

Composer php 编写器安装或更新引发异常,composer-php,Composer Php,我无法使我的composer安装或composer更新工作,出现以下错误。 如果我运行composer安装或composer更新,需要很长时间,最后会抛出错误 运行此命令时: composer update 我得到以下输出: Loading composer repositories with package information [Composer\Downloader\TransportException]

我无法使我的composer安装或composer更新工作,出现以下错误。 如果我运行composer安装或composer更新,需要很长时间,最后会抛出错误

运行此命令时:

composer update
我得到以下输出:

Loading composer repositories with package information


[Composer\Downloader\TransportException]                                                                             
The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out  


update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...
我的系统配置:

  • 操作系统:Ubuntu 16.04.4 LTS
  • PHP:php7.0.30-1+ubuntu16.04.1+deb.sury.org+1(cli)
  • 作曲家版本:1.6.5 2018-05-04 11:44:59
我在谷歌上搜索了很多,但没有找到适合我的解决方案,请帮我找出答案


谢谢

当时PackageGist已关闭,或者您的服务器由于其他原因(防火墙、DNS问题等)无法访问它。试试卷曲https://packagist.org/packages.json看看会发生什么。@ceejayoz从上面的curl调用中,我收到了jsonresponse@ceejayoz但是编写器更新仍然失败
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: Connection timed out
Checking https connectivity to packagist: WARNING
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.6.5
PHP version: 7.0.30-1+ubuntu16.04.1+deb.sury.org+1
PHP binary path: /usr/bin/php7.0