E
E
edik892016-11-03 18:31:31
Vagrant
edik89, 2016-11-03 18:31:31

How to execute composer update in vagrant?

There is an Ubuntu virtual machine created via vagrant, there is a site on the local machine that is synchronized with the guest machine using the setting in the Vagrantfile:

config.vm.synced_folder "www", "/home/vagrant/www", :create => true
. Also in settings:
config.vm.network "forwarded_port", guest: 80, host: 8080

Everything works and the site opens at example.com:8080
The problem occurs when trying to execute composer update from the virtual machine console. Gives the following:
[Composer\Downloader\TransportException]
Content-Length mismatch

Has anyone come across?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Leonid S, 2016-11-24
@edik89

Yes, I had the same problem.
1. If there is an antivirus, then it is better to disable it for a while
2. Disabled ipv6:

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

3. Force composer to work on https:
php composer.phar config --global repo.packagist composer https://packagist.org

And then everything started.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question