学无先后,达者为师

网站首页 编程语言 正文

执行composer安装命令报错处理

作者:左手江湖 更新时间: 2022-01-29 编程语言

执行composer安装命令报错

php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"

PHP Warning:  copy(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify fa
iled in Command line code on line 1

Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify fa
iled in Command line code on line 1
PHP Warning:  copy(): Failed to enable crypto in Command line code on line 1

Warning: copy(): Failed to enable crypto in Command line code on line 1
PHP Warning:  copy(https://install.phpcomposer.com/installer): failed to open st
ream: operation failed in Command line code on line 1

Warning: copy(https://install.phpcomposer.com/installer): failed to open stream:
 operation failed in Command line code on line 1
 

 解决办法
下载证书https://curl.se/docs/caextract.html
配置到php.ini文件中
例如我的证书文件在D:\phpstudy_pro\Extensions\php\cacert-2020-10-14.pem中。
openssl.cafile= D:\phpstudy_pro\Extensions\php\cacert-2020-10-14.pem

原文链接:https://blog.csdn.net/shaofei1986/article/details/118962054

栏目分类
最近更新