宝塔安装完lnmp环境,安装php composer-setup.php --2.1时报错(无论是否指定版本号都会报错):
All settings correct for using Composer
Downloading...
The "https://install.phpcomposer.com/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Retrying...
The "https://install.phpcomposer.com/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Retrying...
The "https://install.phpcomposer.com/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
The download failed repeatedly, aborting.
百度结果是证书问题,先查看系统默认位置
php -r "var_dump(openssl_get_cert_locations());"
各种博客上全是说替换默认的default_cert_file 位置即可,但是,我测试还需要替换php.ini中的openssl.cafile ,也就是上面查询命令中显示的倒数第二项,两者的值都用你下载的证书路径就行。