解决 [Composer\Exception\NoSslException] The openssl extension is required for SSL/TLS protection

问题:小编最近想学学Thinkphp6,但是在使用Composer安装的时候,报如下错误:

解决 [Composer\Exception\NoSslException] The openssl extension is required for SSL/TLS protection

安装Composer:

1、Composer下载地址:https://www.phpcomposer.com 

2、安装Composer

3、如果安装了Composer旧版本,更新命令:composer selfupdate

解决办法:

1、首先检查有没有启用openssl扩展,在对应的PHP版本中找到 php.ini 文件

      找到extension=php_openssl.dll这配置项,把前面的分号去掉

2、在浏览器中输入http://localhost/phpinfo.php

解决 [Composer\Exception\NoSslException] The openssl extension is required for SSL/TLS protection

3、在对应php版本中,找到 php_openssl.dll, ssleay32.dll, libeay32.dll 这3个文件:

      php_openssl.dll:在php根目录/ext文件夹下

      ssleay32.dll:在php根目录下

      libeay32.dll:在php根目录下

4、将这3个文件放到 C:\Windows\System32 目录下

5、打开cmd命令,输入:php -m  看看有没有openssl

解决 [Composer\Exception\NoSslException] The openssl extension is required for SSL/TLS protection

就这样就解决了这个问题!