在Digital Ocean上更新Composer时出现连接超时错误 [英] Connection timeout error while updating composer on Digital Ocean
问题描述
我可以把自己的水滴塞进去。
I am able to ssh into my droplet. Am also able to apt update and apt upgrade.
当我尝试运行sudo composer自我更新或composer更新时,出现连接超时错误。
When I try to run sudo composer self-update or composer update, I am getting connection timeout error.
The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: Connection timed out
ufw状态的输出
To Action From
22 ALLOW Anywhere
80 ALLOW Anywhere
443 ALLOW Anywhere
25 ALLOW Anywhere
10000 ALLOW Anywhere
编写者诊断的输出
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: FAIL
[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: FAIL
[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 composer version:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/version" file could not be downloaded: failed
to open stream: Connection timed out
composer --version
output of composer --version
Composer version 1.0-dev (9e9c1917e1ed9f3f78b195a785aee3c6dc3cb883) 2015-11-23 10:31:23
输出 curl IL http://packagist.org/packages.json
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 10 Dec 2017 08:40:20 GMT
Content-Type: application/json
Content-Length: 1302
Last-Modified: Sun, 10 Dec 2017 08:38:28 GMT
Connection: keep-alive
ETag: "5a2cf284-516"
Cache-Control: private, max-age=0, no-cache
Accept-Ranges: bytes
我试图手动获取最新作曲家的副本,但它也没有t工作
I tried to manually get a copy of latest composer but it also doesn't work
php的输出-r copy('https://getcomposer.org/installer','composer-setup.php' );
PHP Warning: copy(https://getcomposer.org/installer): failed to open stream: Connection timed out in Command line code on line 1
这是什么原因?大约一个星期前,我一直在工作。我可以访问(浏览)Droplet上托管的网页。
What could be the reason? I was all working till about a week ago. I am able to visit (browse) the webpages hosted on my droplett. Am also able to apt update and apt upgrade.
推荐答案
> https://getcomposer.org/doc/articles/troubleshooting.md#operation-timed-out-ipv6-issues- 可以解决您的问题。如果之后 composer更新
缓慢,请尝试使用更新的PHP版本运行它。使用PHP 7而不是PHP 5运行它将大大提高速度
https://getcomposer.org/doc/articles/troubleshooting.md#operation-timed-out-ipv6-issues- could solve your problem. And if composer update
is slow afterwards, try running it with a more recent PHP version. Running it with PHP 7 instead of PHP 5 will cause a big speedup
这篇关于在Digital Ocean上更新Composer时出现连接超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!