Laravel composer install hangs on "Installing dependencies" and consume a lot of resources (CPU, DISK)

composer install freeze
composer installation failed
composer install not working
composer update
composer xdebug
composer install stuck updating dependencies including require dev
composer require frozen
something's changed, looking at all rules again
Problem 1:

I tried install laravel 4 on my server (Ubuntu 12.04, nginx, php5-fpm) but installation hangs:

# composer install --verbose
Loading composer repositories with package information
Installing dependencies (including require-dev)

- no errors, no nothing, it's just hangs and that's all. I've tried installation using composer create-project laravel/laravel --prefer-dist ...and result was pretty the same:

Installing laravel/laravel (v4.0.9)
- Installing laravel/laravel (v4.0.9)
Loading from cache

Created project in /var/www/laravel/ex2/laravel
Loading composer repositories with package information
Installing dependencies (including require-dev)

I couldn't find any ideas/solutions.

Could anyone please tell me what is the problem and how could I fix it?

Problem 2:

@antonio-carlos-ribeiro was right, I just need to wait. But now I've got another problem:

Installation takes more than 30 minutes! And a lot of resources (CPU and DISK usage)... unbelievable amount of resources. Here is graphs of CPU and DISK read/write: I guess it's not normal behavior. Any ideas what is going on?

Thanks!

This is Composer being slow. You need to wait for it and, yeah, it may be a lot of time.

You also can try to download the packages one by one, installing Laravel "manually"

Create your directory and enter it:

mkdir /var/www/laravel/ex2/laravel
cd /var/www/laravel/ex2/laravel

Dowload all packages ony by one:

composer require filp/whoops 1.0.7
composer require nikic/php-parser dev-master#700847e
composer require jeremeamia/superclosure 1.0.1
composer require doctrine/lexer dev-master#bc0e1f0
composer require doctrine/annotations v1.1.2
composer require doctrine/collections dev-master#bcb5377
composer require doctrine/cache v1.3.0
composer require doctrine/inflector dev-master#8b4b3cc
composer require doctrine/common dev-master#d9dea98
composer require doctrine/dbal 2.4.x-dev#9efdbce
composer require psr/log 1.0.0
composer require monolog/monolog dev-master#a501075
composer require symfony/translation 2.3.x-dev#6aedcff
composer require symfony/routing 2.3.x-dev#7d41463
composer require symfony/process 2.3.x-dev#8289810
composer require symfony/debug 2.3.x-dev#085d4fd
composer require symfony/http-foundation 2.3.x-dev#796619f
composer require symfony/event-dispatcher 2.3.x-dev#2d8ece3
composer require symfony/http-kernel 2.3.x-dev#9795c9f
composer require symfony/finder 2.3.x-dev#a175521
composer require symfony/dom-crawler 2.3.x-dev#4dc2c59
composer require symfony/css-selector 2.3.x-dev#8df20c5
composer require symfony/console 2.3.x-dev#f880062
composer require symfony/browser-kit 2.3.x-dev#7fc66ea
composer require symfony/filesystem dev-master#e558fd5
composer require swiftmailer/swiftmailer v5.0.2
composer require predis/predis 0.8.x-dev#ff004ae
composer require patchwork/utf8 v1.1.14
composer require nesbot/carbon 1.4.0
composer require ircmaxell/password-compat 1.0.x-dev#1fc1521
composer require classpreloader/classpreloader 1.0.1

Finally download Laravel

composer require laravel/framework 4.0.x-dev
composer require laravel/laravel 4.0.x

Move it to the right place

mv -f vendor/laravel/laravel/* .
mv -f vendor/laravel/laravel/.g* .
rm -rf vendor/laravel/laravel

And execute this to fix your composer.lock

composer update

After downloading the packages, Composer will cache them in your home folder, so next install you don't have to download all of them manually, unless, of course, some are updated.

Note: this is will work only for Laravel 4.0.9, since some of those packages are "marked" to download an specific commit (example: #700847e).

Composer 'hangs' for more than 12 hours in Laravel 4.1 install , See also this Laravel ticket. I'm running PHP 5.4.25 on Ubuntu 12.04 LTS. I'm using composer version 7343198. Here is my composer.json file:� composer install hangs for more than 12 hours without completing. The otherwise same composer.json file worked fine for Laravel 4.0.*. What am I doing wrong?

I was installing it on a windows machine in xampp directory and found that it was hanged while the Apache was running and when i stopped the Apache it starts immediately and ends in some in secs.

Running an update just hangs � Issue #1959 � composer/composer , composer install hangs sonata-project/SonataUserBundle#464 vinkla added a commit to vinkla/laravel-translator that referenced this issue� The execution of composer (install, update, create-project) hangs after composer has finished with an blinking cursor and idle cpu - but the batch script won't exit. It is possible to end the process with ctrl+c. The problem occurs for most of my Laravel and Symfony Projects and seems not to depended on a certain composer.json / .lock. Window 10

For me was composer vendor. I did just composer -vvv update

Running 'composer update' hangs, I've got a Laravel based project that I'm updating to version 5.6. To do so I need to update some PHP packages with composer. When I run� A common dis-functionality of Composer is that when it just hangs while installing or updating dependencies. Especially when using heavy packages like these of Symfony, Composer is going to run hard.

Make sure you are not having xdebug enabled by default. If you have, turn it off.

I had the similar problem where loading JSON dependencies took an hour (for Laravel). After turning off xdebug for cli everything loads in several seconds!

Composer update hangs, composer update: hangs at: Loading composer repositories with package information Updating dependencies (including require-dev) Any help will be appre I tried updating a Laravel project I'm working on today using composer update. But it hung on Updating dependencies (including require-dev). So I tried things like updating composer, dump-autoload, but nothing seemed to work.

One possibility is that you have un-resolvable dependencies:

Your requirements could not be resolved to an installable set of packages.

As the others have mentioned you may need to just run composer install and wait. If the dependencies cannot be resolved, composer will scan every possible option - which may take a long time.

If you have lots of dependencies - you might want to try and remove everything from composer.json first, then add them back in one at a time to discover which ones are failing to resolve.

When composer install eventually finishes - read the output carefully, and see if there are missing dependencies you need to install manually.

In my case I was only trying to install a single package. This was my composer.json:

{
    "require-dev": {
        "phpunit/phpunit": "^8"
}

composer install took a long time to run but eventually reported:

  Problem 1
- phpunit/phpunit 8.5.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.5.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.5.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- Installation request for phpunit/phpunit ^8 -> satisfiable by phpunit/phpunit[8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 8.1.0, 8.1.1, 8.1.2, 8.1.3, 8.1.4, 8.1.5, 8.1.6, 8.2.0, 8.2.1, 8.2.2, 8.2.3, 8.2.4, 8.2.5, 8.3.0, 8.3.1, 8.3.2, 8.3.3, 8.3.4, 8.3.5, 8.4.0, 8.4.1, 8.4.2, 8.4.3, 8.5.0, 8.5.1, 8.5.2].

So I installed the missing dependency - PHP extension dom:

sudo apt install php-dom

Next time I ran composer install it completed successfully.

Troubleshooting, Composer hangs with SSH ControlMaster#. When you try to install packages from a Git repository and� On a Windows 7 64bit machine composer is hanging on "installing dependencies" but php.exe is running 50% in system monitor. I tried several symfony packages with the same result and also tried create-project for a laravel installation wi

Composer hanging while updating dependencies, I tried updating a Laravel project I'm working on today using composer update. But it hung on Updating dependencies (including require-dev). So I tried things� Composer hangs with SSH ControlMaster# When you try to install packages from a Git repository and you use the ControlMaster setting for your SSH connection, Composer might hang endlessly and you see a sh process in the defunct state in your process list.

Composer stuck at Something's changed looking at all rules again , While upgrading one of my laravel application from version 5.3 to 5.4, The situation was that when running composer install it was getting stuck at But in cases like mine, it calculates the rules in circles and gets stuck for� For instance, laravel new blog will create a directory named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed: laravel new blog Via Composer Create-Project. Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal:

Laravel 7.x & Composer Installation Tutorial (Windows & CMD error , This stops the Composer commands from executing in the command-line/ terminal until you update your %PATH% variable. The default� Download Composer Latest: v1.10.10. To quickly install Composer in the current directory, run the following script in your terminal. To automate the installation, use the guide on installing Composer programmatically.

Comments
  • Thanks. It finally happend :) But it takes more than 30 minutes! And a lot of resources (CPU and DISK usage)... unbelievable amount of resources. Here is graphs of CPU and DISK read/write: dropbox.com/s/gx2excfbae57guo/… I gues it not normal behavior Any Ideas what is going on?
  • I'm doing the same thing for me now on an EC2 server and it's over 20 minutes now. I'm not use to composer taking this long. :(
  • @Foxinni Your ref: Deploying with composer on EC2 instances small and micro is awfully slow once your project gets "big enough". Changing the instance type to t3-medium seems to be a whole lot faster.
  • Or you could simply create an archive of the vendor directory and upload it to your machine instead of using composer install. I believe it would save a lot of time. :)
  • This solved my problem, I stopped apache service and it worked dont know why.
  • its actually not hangs, with -vvv command we can see that its downloading
  • Exactly the issue (HP 5.6 on Windows, Laravel 5 for further information on my situation), removed xdebug lines from php.ini whilst running composer and it only took about 2 minutes.