composer安装报错:
[root@b0e064acf481 ~]# php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
PHP Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_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
PHP Warning: copy(https://install.phpcomposer.com/installer): failed to open stream: operation failed in Command line code on line 1
可以用下面方法试试:
[root@b0e064acf481 ~]# wget http://curl.haxx.se/ca/cacert.pem
[root@b0e064acf481 ~]# curl -sS https://getcomposer.org/installer | php -- --cafile=cacert.pem
[root@b0e064acf481 ~]# cp composer.phar /usr/local/bin/composer
[root@b0e064acf481 ~]# composer -V
Composer version 2.1.12 2021-11-09 16:02:04