gpt4 book ai didi

php - 无法运行 Composer 安装

转载 作者:可可西里 更新时间:2023-11-01 12:17:14 26 4
gpt4 key购买 nike

我试图在我的项目中运行 composer install 但出现以下错误

[Composer\Downloader\TransportException]
The "http://packagist.org/p/provider-2013$43e3f41fbe30a46245103451248f688a727f076a6e90636d19a69a156c17a416.json" file could not be downloaded (HTTP/1.1 400 Received invalid request from Client)

我尝试运行 composer self-update 并出现此错误

[Composer\Downloader\TransportException]
The "https://getcomposer.org/version" file could not be downloaded: Failed to enable crypto failed to open stream: operation failed

我在代理后面运行带有 apache/php5.6.4/mysql 的 Ubuntu 15.04。

我试过下载 http://curl.haxx.se/ca/cacert.pem并使用以下内容更新了我的 php.ini 文件

curl.cainfo=/etc/ssl/certs/cacert.pem
openssl.cafile=/etc/ssl/certs/cacert.pem
openssl.capath=/etc/ssl/certs

运行 Composer 诊断返回这个

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: FAIL
[Composer\Downloader\TransportException] The "http://packagist.org/packages.json" file could not be downloaded (HTTP/1.1 400 Received invalid request from Client)
Checking https connectivity to packagist: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: FAIL
Unable to assess the situation, maybe packagist.org is down (The "http://packagist.org/packages.json" file could not be downloaded (HTTP/1.1 400 Received invalid request from Client))
Checking HTTPS proxy support for request_fulluri: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: FAIL
You are not running the latest version

最后 openssl_get_cert_locations() 返回

  • 默认证书文件:/usr/lib/ssl/cert.pem
  • default_cert_file_env:SSL_CERT_FILE
  • 默认证书目录:/usr/lib/ssl/certs
  • default_cert_dir_env:SSL_CERT_DIR
  • default_private_dir:/usr/lib/ssl/private
  • default_default_cert_area:/usr/lib/ssl
  • ini_cafile:/etc/ssl/certs/cacert.pem
  • ini_capath:/etc/ssl/certs

我完全不知道出了什么问题,更不知道如何调试它。

我希望有人能帮助我!

最佳答案

你也一样。我在互联网上找到了解决它的方法(对于窗口 10)。1 - 转到文件夹 PATH\xampp\apache 并运行 makecert.bat2 - 将此脚本添加到 composer.json 文件

"repositories": [
{
"type": "composer",
"url": "https://packagist.org"
},
{
"packagist": false
}
]

关于php - 无法运行 Composer 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31744309/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com