Composer does not install packages

1

Recently I installed ubuntu on my machine and I'm preparing the environment to work with Laravel. Everything is working except that I can not create the Laravel project, when I execute command

composer create-project laravel/laravel projeto

It runs infinitely, and nothing happens. No error message is displayed, and nothing is installed. I tried to download the composer again and now it's making eternal donwload. As soon as I inhaled Ubuntu, I was able to do the composer download, right after that I did an update that Ubuntu was asking for and then I can no longer use the composer, I can not say that the update is responsible for that. Thanks for all the help.

    
asked by anonymous 03.03.2016 / 19:45

3 answers

3

The problem described here is related to IPv6, just disable it, or give more precedence to Ipv4 to re-operate. For Ubuntu 14.04 use the following command.

sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"

For more information visit the link: getcomposer.org

    
06.03.2016 / 16:12
1

When you create a project, Laravel should already be installed, you probably did not run the Installer, do this first of all:

composer global require "laravel/installer"

Then try to create a project using exactly this command with --prefer-dist :

composer create-project --prefer-dist laravel/laravel projeto

Reinstalling the composer

I recommend that you try to uninstall the composer if the commands do not work, so delete the composer.phar and remove the /home/<user>/.composer .

And then reinstall:

curl -sS http://getcomposer.org/installer | php
    
03.03.2016 / 20:06
-2

Probably the composer is trying to install everything, but his internet is slow, and there it is taking to download all the packages.

Run the command with -vvv to see what is happening: composer create-project laravel/laravel projeto -vvv

    
03.03.2016 / 20:24