今天运行composer时出现如下错误
The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.
网上提示使用如下命令,
composer config -g -- disable-tls true
但依旧有如下错误:
You are running Composer with SSL/TLS protection disabled.
最后通过以下方法解决。
启用 openssl方法如下
修改php.ini:
去掉openssl 前的;
下载http://curl.haxx.se/ca/cacert.pem 放到D:\Composer\ 文件夹下
在php.ini 中添加
openssl.cafile=D:/Composer/cacert.pem