I have to install the magento 2.3.6 on my vagrant VM it actually already working on other VMs but today I have created another VM and start installing the magento2 but got this weird error at some point when it start downloading the base/magento2.3.6

Downloading (10%)
Downloading (10%)

  Content-Length mismatch, received 4447103 bytes out of the expected 40360494

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

Tried with the allow_url_fopen On it is not still working getting the same error.

Is there any work around to fix this issue?

Any help will be appreciated:

Thanks and Regards,

1 Answer 1


Just change the composer default repo URL using the below command, also make sure your internet connection speed

composer config -g repo.packagist composer https://packagist.org
composer config -g github-protocols https ssh

It changes or sets the package repo to be used by HTTPS only.

This fixes any issues with local composer.json files too. No need to mess around with the composer.json file locally or globally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.