Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
composer image does not support https cause
Open the command line window (windows users) or console ( Linux, Mac users), enter the root directory of your project (that is, the directory where the composer.json file is located) and execute the following command:
composer config repo.packagist composer https://packagist.phpcomposer.com
The above command will automatically add the image configuration information at the end of the composer.json file in the current project (you can also add it manually):
"repositories": {
"packagist": {
"type": "composer",
“url”: “https://packagist.phpcomposer.com”
}
}
Taking the composer.json configuration file of the laravel project as an example, after executing the above command, it will look as follows (note the last few lines):
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
“license”: “MIT”,
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
“symfony/css-selector”: “2.8.|3.0.“,
"symfony/dom-crawler": "2.8.|3.0."
},
"autoload": {
"classmap": [
“database”
],
"psr-4": {
"App": "app/"
}
},
"autoload-dev": {
"classmap": [
“tests/TestCase.php”
]
},
"scripts": {
"post-root-package-install": [
“php -r ”copy(‘.env.example’, ‘.env’);””
],
"post-create-project-cmd": [
“php artisan key:generate”
],
"post-install-cmd": [
“php artisan clear-compiled”,
“php artisan optimize”
],
"pre-update-cmd": [
“php artisan clear-compiled”
],
"post-update-cmd": [
“php artisan optimize”
]
},
"config": {
“preferred-install”: “dist”
},
"repositories": {
"packagist": {
"type": "composer",
“url”: “https://packagist.phpcomposer.com”
}
}
}
OK, everything is done! Try composer install to experience the incredible speed!
The above introduces how to solve composer install or update error problems, including composer aspects. I hope it will be helpful to friends who are interested in PHP tutorials.