Why is updating dependencies in composer so slow?

Viewed 4869

I'm using composer (http://getcomposer.org/) to manage dependencies in Symfony2 (Symfony v 2.8) here https://poweredtemplate.com

I have a problem with the fact that when I add a new dependency in composer.json, for example "composer require hwi / oauth-bundle", the dependency is added for a very long time (~20min), or gives me the error "PHP Fatal error: Allowed memory size of ..."

Is there any way to make this process faster?

2 Answers

you could do a few things:

1) use --prefer-dist

2) check if Xdebug is loaded.

php -m | grep xdebug

3) you can additonaly enable verbosity to see what operations are taking too long

--prefer-dist -vvv

You need to change the owner from the ~/.composer folder.

sudo chown -R $USER ~/.composer

Without this permission, composer can't install the packages in the cache folder.

Related