Answer the question
In order to leave comments, you need to log in
Why does composer update hang?
Here's a composer.json (taken from Silex Skeleton ):
{
"name": "fabpot/silex-skeleton",
"description": "A pre-configured skeleton for the Silex microframework",
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.3.3",
"silex/silex": "~1.1",
"silex/web-profiler": "~1.0",
"symfony/browser-kit": "~2.3",
"symfony/class-loader": "~2.3",
"symfony/config": "~2.3",
"symfony/console": "~2.3",
"symfony/css-selector": "~2.3",
"symfony/debug": "~2.3",
"symfony/finder": "~2.3",
"symfony/form": "~2.3",
"symfony/monolog-bridge": "~2.3",
"symfony/process": "~2.3",
"symfony/security": "~2.3",
"symfony/translation": "~2.3",
"symfony/twig-bridge": "~2.3",
"symfony/validator": "~2.3",
"doctrine/dbal": "2.2.*"
},
"autoload": {
"psr-0": { "": "src/" }
},
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"minimum-stability": "dev"
}
doctrine/dbal
But at startup composer update
the process hangs. Writes:Loading composer repositories with package information
Installing dependencies (including require-dev)
Answer the question
In order to leave comments, you need to log in
In general, with the help of the flag --profile
, it was possible to establish the cause. Everything rested on a lack of memory. I increased the amount of RAM to 1GB (it was 384MB) and the update completed successfully. The peak memory usage was 569.84MB.
Additionally, for those who in the future will encounter a similar problem, on github I found another possible reason for this hang. Its essence, as I understand it, is that with a large number of dependencies, the composer can "freeze" due to the large number of their possible combinations. This happens very rarely, but theoretically possible. The solution in this case is to set the requirements more strictly. For example, use a more specific version framework, or generally specify the exact version.
Composer latest version - after selfupdate? Try to install the latest release, without updating, if so
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question