简体   繁体   English

尝试在 Windows 10 上安装 Composer 时出错

[英]Error when trying to install composer on Windows 10

I'm trying to install composer on Windows but I get the following error:我正在尝试在 Windows 上安装 Composer,但出现以下错误:

The " https://getcomposer.org/versions " file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:无法下载“ https://getcomposer.org/versions ”文件:SSL 操作失败,代码为 1。OpenSSL 错误消息:

error: 1416F086: SSL routines: tls_process_server_certificate: certificate verify failed Failed to enable crypto failed to open stream: operation failed错误:1416F086:SSL 例程:tls_process_server_certificate:证书验证失败无法启用加密无法打开流:操作失败

Use Command and check certificate is exists or not:使用命令检查证书是否存在:

php -r "print_r(openssl_get_cert_locations());"

You will get Output like this :你会得到这样的输出:

Array (大批 (

[default_cert_file] => /Applications/XAMPP/xamppfiles/share/openssl/cert.pem [default_cert_file_env] => SSL_CERT_FILE [default_cert_dir] => /Applications/XAMPP/xamppfiles/share/openssl/certs [default_cert_dir_env] => SSL_CERT_DIR [default_private_dir] =>/Applications/XAMPP/xamppfiles/share/openssl/private [default_default_cert_area] =>/Applications/XAMPP/xamppfiles/share/openssl [ini_cafile] => [ini_capath] => ) [default_cert_file] => /Applications/XAMPP/xamppfiles/share/openssl/cert.pem [default_cert_file_env] => SSL_CERT_FILE [default_cert_dir] => /Applications/XAMPP/xamppfiles/share/openssl/certs [default_cert_dir_env] => SSL_default ] =>/Applications/XAMPP/xamppfiles/share/openssl/private [default_default_cert_area] =>/Applications/XAMPP/xamppfiles/share/openssl [ini_cafile] => [ini_capath] => )

Check :查看 :

cert.pem file exists or not. cert.pem 文件是否存在。

For me disabling the Antivirus solved the issue对我来说禁用防病毒解决了这个问题

  • Disable Antivirus禁用防病毒软件
  • Close the terminal关闭终端
  • Reopen the Terminal and type "composer diagnose" to check if problem is solved.重新打开终端并输入“composer 诊断”以检查问题是否已解决。
  • Re-enable Antivirus重新启用防病毒软件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM