Composer在Windows上不起作用,显示[Composer \ Exception \ NoSslException]错误 [英] Composer not working on windows, gives [Composer\Exception\NoSslException] error

查看:92
本文介绍了Composer在Windows上不起作用,显示[Composer \ Exception \ NoSslException]错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows 10上安装laravel.我安装了composer来安装laravel,但这给了我下面的错误.

I'm trying to install laravel on windows 10. I installed composer to install laravel but it gives me below error.

[Composer \ Exception \ NoSslException] openssl扩展名是SSL/TLS保护必需,但不可用.如果可以的话不启用openssl扩展名,可以在禁用此错误通过将"disable-tls"选项设置为true,后果自负.

[Composer\Exception\NoSslException] The openssl extension is required for SSL/TLS protection but is not availab le. 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.

命令无关紧要,所有命令都会出现上述错误...

Command doesn't matteri it gives above error with all commands...

我检查了这个问题并使用了解决方案,但对我不起作用.

I checked out this question and used solutions but it didin't work for me..

我尝试了这些解决方案

composer config -g -- disable-tls true

extension=php_openssl.dll // open openssl extension in php.ini file. - I restarted apache after that but nothing changed

推荐答案

我遇到了同样的问题.为了确保作曲家能正常工作,我做了以下事情.

I had the same issue. I did the following things to make sure the composer works out.

  • 找到与您发出命令的位置相对应的php.ini.

php --ini

校正前的样本输出:

Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File:         (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

这里的C:\ WINDOWS是一个骗局.当我查看php安装目录时,发现没有php.ini.有两个文件 php.ini-development php.ini-production .只需将一个重命名为 php.ini

This C:\WINDOWS here is a hoax. When I looked in the php installation directory, I found out there is NO php.ini. There are two files php.ini-development and php.ini-production. Just rename one to php.ini

然后,当您执行 php --ini

  • 设置扩展目录

然后,打开php.ini文件并取消注释以下行; extension_dir ="ext" 应该是

Afterwards, open the php.ini file and uncomment the following line ;extension_dir = "ext" should be

extension_dir = "ext"

  • 启用扩展名
  • 然后以相同方式取消注释扩展.通常需要以下内容.(但是,请根据在作曲家命令中看到的消息,找出您需要的内容)

    Then uncomment the extensions the same way. The following are usually required. (But please find out what you need from the messages you see from composer commands)

    extension=fileinfo
    extension=gd2
    extension=mbstring
    extension=openssl
    

    这篇关于Composer在Windows上不起作用,显示[Composer \ Exception \ NoSslException]错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆