composer install or update 报错问题解决 solidworks composer laravel avid media composer

WBOY
发布: 2016-07-29 08:55:21
原创
1462 人浏览过

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镜像不支持https引起

打开命令行窗口(windows用户)或控制台(Linux、Mac 用户),进入你的项目的根目录(也就是 composer.json 文件所在目录),执行如下命令:

composer config repo.packagist composer https://packagist.phpcomposer.com
上述命令将会在当前项目中的 composer.json 文件的末尾自动添加镜像的配置信息(你也可以自己手工添加):

“repositories”: {
“packagist”: {
“type”: “composer”,
“url”: “https://packagist.phpcomposer.com”
}
}
以 laravel 项目的 composer.json 配置文件为例,执行上述命令后如下所示(注意最后几行):

{
“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,一切搞定!试一下 composer install 来体验飞一般的速度吧!

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了composer install or update 报错问题解决,包括了composer方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板