完整错误
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
解决办法
- 下载证书下载证书
- 配置到
php.ini
文件中
例如我的证书
文件在D:\phpstudy_pro\Extensions\php\cacert-2020-10-14.pem
中。
openssl.cafile= D:\phpstudy_pro\Extensions\php\cacert-2020-10-14.pem
Comment here is closed