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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -