我设置了 Packagist 为我们的项目提供本地包系统,但是本地 Gitlab 服务器只能运行http://
。Packagist在哪里使用composer.json?这就是我要补充的吗?
{
"config": {
"secure-http": false
}
}
为清楚起见,当我尝试向 Packagist 提交存储库时,错误是:
Uncaught Exception: [ComposerDownloaderTransportException] Your configuration does not allow connections to http://custom-server/custom/repo.git. See https://getcomposer.org/doc/06-config.md#secure-http for details.
我浏览了Packagist源代码,找到了它试图加载的文件(/usr/share/httpd/.composer/config.json)。我假设该目录取决于您的 Web 服务器。
所以我创建了这个文件:
/usr/share/httpd/.composer/config.json
内容:
{
"config": {
"secure-http": false
}
}
查询:
$/opt/cpanel/composer/bin/composer config secure-http
设置假
$/opt/cpanel/composer/bin/composer config secure-http false
设为真
$/opt/cpanel/composer/bin/composer config secure-http true
有关详细信息,请参阅:
$composer config -h