Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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: Disk read/write and CPU usage I guess it's not normal behavior. Any ideas what is going on?

Thanks!

like image 821
pupadupa Avatar asked Nov 06 '13 23:11

pupadupa


People also ask

Why is composer update so slow?

Composer update is very slow if you have a lot of dependencies/packages implemented. You should avoid variable versions and think about using a HHVM as server.

What is composer dependencies in laravel?

Composer is a dependency manager for a PHP programming language that manages the dependencies of PHP software and required libraries. Nils Adermann and Jordi Boggiano developed the Composer. They started development in April 2011 and first it was released on March 1, 2012.

What is composer install in laravel?

phar install (or composer install ) command to install all of the framework's dependencies. This process requires Git to be installed on the server to successfully complete the installation. If you want to update the Laravel framework, you may issue the php composer.


2 Answers

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).

like image 131
Antonio Carlos Ribeiro Avatar answered Oct 12 '22 13:10

Antonio Carlos Ribeiro


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

like image 34
Militaru Avatar answered Oct 12 '22 12:10

Militaru