摘要:下面由composer教程栏目给大家介绍解决composer错误:Composer\\Downloader\\TransportException的方法,希望对需要的朋友有所帮助! [Composer\\Downloader\\TransportException]
下面由composer教程栏目给大家介绍解决composer错误:Composer\\Downloader\\TransportException的方法,希望对需要的朋友有所帮助!
[Composer\\Downloader\\TransportException] The "http://packagist.org/packages.json" file could not be downloaded: failed to open stream: HTTP request failed!create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--n o-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [package] [directory] [version]
解决方法禁用https请求,改用http方式。所以我们在composer.json文件中设置一个本地或全局的composer配置config
方法一:命令行composer config secure-http false。通过命令修改composer.json,效果等同方法二。
方法二:直接改composer.json,给“config”项中加上"secure-http": false
"config" : { "vendor-dir" : "packages", "secure-http": false }
全局配置(推荐)
composer config -l -g//切换到国内源 阿里composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/composer config -g --unset repos.packagist
相关文章推荐
网站谷歌评分90+意味着什么?2022-09-06
怎样将不安全网站变成安全网站访问?2022-09-26
网站排名下降,可能跟算法更新没关系2022-09-20
网站如何设置高质量的网页标题?2022-09-14
做外贸网站选哪些语言?法语、德语最吃香2022-09-13