宝塔安装完lnmp环境,手工在浏览器下载
https://getcomposer.org/installer
并重命名为composer-setup.php,该文件负责检查环境,并下载单一的composer程序文件。执行命令 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 ,也就是上面查询命令中显示的倒数第二项,两者的值都用你下载的证书路径就行。
最后为了方便大家使用,我已经把几个版本上传到码云
标签:宝塔,certificate,failed,get,SSL,composer,operation,php,安装 From: https://blog.51cto.com/u_6132776/9219487