完整错误

  C:\Users\Administrator>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 failed 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 failed 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 stream: 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

解决办法

例如我的证书文件在D:\phpstudy_pro\Extensions\php\cacert-2020-10-14.pem中。

openssl.cafile= D:\phpstudy_pro\Extensions\php\cacert-2020-10-14.pem

重启一下即可

Last modification:October 29, 2020
如果觉得我的文章对你有用,请随意赞赏