packagist - Composer Content-Length Mismatch -
sometime, when run composer update upgrade laravel project, may occur content-length mismatch exception. finally, because terrible firewall in china: dns poisoned. so, if 1 me, follows fix out.
first, run:
composer config --list --global //this composer home path. [home] /root/.composer //it's composer home path.
and then, edit config.json, make this:
{ "config": { "github-protocols": [ "https" ] }, "repositories": { "packagist": { "type": "composer", "url": "https://packagist.org" } } }
it make packagist connection force https. , config composer.json in project, laravel sample like:
{ "name": "laravel/laravel", "description": "the laravel framework.", "keywords": [ "framework", "laravel" ], "license": "mit", "type": "project", "require": { "php": ">=5.5.9", "laravel/framework": "5.2.*" }, "config": { "preferred-install": "dist" }, "repositories": { "packagist": { "type": "composer", "url": "https://packagist.org" } } }
Comments
Post a Comment