score:127

Accepted answer

try composer update/install -o -vvv and check wether the package is being loaded from composer's cache.

if yes try clearing composer's cache or try adding -cache-dir=/dev/null.

to force downloading an archive instead of cloning sources, use the --prefer-dist option in combination with --no-dev.

otherwise you could try raising composer's process timeout value:

export composer_process_timeout=600   ( defaults to 300 )

score:-1

this is the problem slow nfs. composer write cache into nfs directory. you must install composer globally and rewrite cache path.

this doesnt work:

php composer.phar install

using this:

composer install

before this run you must config composer globally. see this https://getcomposer.org/doc/00-intro.md#globally

also, you must add this lines to your config.json:

"config": {
    "cache-dir": "/var/cache/composer"
}

works for me.

score:2

i agree with most of what has been suggested above, but i had the same issue and what worked for me was deleting the vendor folder and re-run composer install

regards

score:4

the symfony component has process timeout set to 60 by default. that's why you get errors like this:

[symfony\component\process\exception\processtimedoutexception]     
the process "composer update" exceeded the timeout of 60 seconds. 

solution

set timeout to 5 minutes or more

$process = new process("composer update");
$process->settimeout(300); // 5 minutes
$process->run();

score:5

deleting composer cache worked for me.

rm -rf ~/.composer/cache/*

score:5

it's an old thread but i found out the reason for time out was running a php debugger (phpstorm was listening to xdebug connections) which caused the process timeout. when i closed the phpstorm or disabled the xdebug extension, no time out occurred.

score:5

old thread but new problem for me. no solutions here were working when trying to install google/apiclient (it failed on google/apiclient-services) on an ubuntu vm within a windows 10 host.

after noticing windows' "antimalware executable" taking up considerable cpu cycles when doing this composer install/update, i disabled "real-time protection" on the windows 10 machine, and my composer update/install worked!!

hope that helps someone.

score:30

composer itself impose a limit on how long it would allow for the remote git operation. a look at the composer documentation confirms that the environment variable composer_process_timeout governs this. the variable is set to a default value of 300 (seconds) which is apparently not enough for a large clone operation using a slow internet connection.

raise this value using:

composer_process_timeout=2000 composer install

score:70

the easiest method is add config option to composer.json file, add process-timeout 0, that's all. it works anywhere.

{
  .....
  "scripts": {
    "start": "php -s 0.0.0.0:8080 -t public public/index.php"
  },
  "config": {
    "process-timeout":0
  }
}

score:79

composer config --global process-timeout 2000

Related Query

More Query from same tag