需要安装Composer,安装地址:https://pkg.phpcomposer.com/#how-to-install-composer
1.执行了php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
2.出错如下:
D:\server\cpmposer>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
3.解决的方法
a.原因是在于没有CA证书导致的,下载CA证书:https://curl.haxx.se/docs/caextract.html
b.修改PHP.ini,指定下载的cacert.pem路径