前段时间把服务器的 OpenSSL 升级了到 1.1.1c 版本,今天安装 Composer 的时候报错了!

报错的指令为:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

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
PHP Warning:  copy(): Failed to enable crypto in Command line code on line 1
PHP Warning:  copy(https://getcomposer.org/installer): failed to open stream: operation failed in Command line code on line 1

经检查,报错是因为无法验证 CA 证书。

分类至 PHP
0条评论