PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 30, 2022

[FIXED] Composer (installing / updating) always fails

 January 30, 2022     composer-php, curl, php     No comments   

Issue

I have a stable connection, however composer always throws Composer\Downloader\TransportException when I run composer update on my project root, followed by messages stating that I had a timeout error while downloading the files.

After running composer diagnose, everything seems to pass the test.

I attempted uninstalling, and, afterwards, I could not install composer. When I download composer with curl -sS https://getcomposer.org/installer | php, composer prints this to the stream:

 ~  curl -sS https://getcomposer.org/installer | php -d detect_unicode=Off
All settings correct for using Composer
Downloading...
Download failed: Failed to open https://getcomposer.org/composer.phar (Operation timed out after 4994 milliseconds with 229148 out of 1016883 bytes received)
Downloading...
Download failed: Failed to open https://getcomposer.org/composer.phar (Operation timed out after 4988 milliseconds with 261916 out of 1016883 bytes received)
Downloading...
SlowTimer [5000ms] at curl: https://getcomposer.org/composer.phar
Download failed: Failed to open https://getcomposer.org/composer.phar (Operation timed out after 4996 milliseconds with 147228 out of 1016883 bytes received)
The download failed repeatedly, aborting.

I am using Ubuntu 14.04 LTS.

Any ideas on why this keeps happening?


Solution

I'm not sure that this applies to your reinstall option, but it might apply to your initial timeout problem (in addition to the suggestions of Vector); I was using hhvm to run composer, which specifies its own request timeout parameters, which override anything that you specify in your composer.json or the environment variables. The previous link contains the appropriate information to configure your timeout in more detail, but my example bash alias may help.

alias composer='hhvm -v ResourceLimit.SocketDefaultTimeout=60 -v Http.SlowQueryThreshold=60000 -v Eval.Jit=false /home/liam/bin/composer'


Answered By - El Yobo
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing