windows中wamp环境composer使用中openssl问题解决

今天在windows下学习lavaral,使用composer update命令报以下错误:php

 

 [Composer\Exception\NoSslException]html


  The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl ex
  tension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.windows

 

大致意思就是composer要求使用openssl链接,百度相关问题,解决思路分为两种:composer

 

1、禁用openssl,结果是治标不治本放弃curl

2、开启php的openssl扩展,下载ca证书ide

 

具体操做以下:学习

 

 

一、开启php扩展,左键wamp-php-php扩展-php_openssl前面打勾。ui

二、在D:\wamp\wamp\bin\php\php5.4.12(看我的安装路径肯定)下找到php.ini文件,用sublime打开。this

查找 extension=php_openssl.dll ,删除extension=php_openssl.dll前面的分号,取消注释,从而启用OpenSSL插件。url

注意:由于SSL链接须要认证,因此继续下面的步骤以前,须要准备好CA证书(建议把证书保存到D:\wamp\wamp\bin\php\php5.4.12\verify目录中),能够从https://curl.haxx.se/docs/caextract.html处下载。(若是直接打开文件的话,另存为修改文件名便可)

三、若是php.ini文件中可以找到

;openssl.cafile=

和上面同样,去掉分号注释,设置CA证书为D:\wamp\wamp\bin\php\php5.4.12\verify,即

openssl.cafile= "D:\wamp\wamp\bin\php\php5.4.12\verify\cacert.pem"若是没法找到直接添加

openssl.cafile= "D:\wamp\wamp\bin\php\php5.4.12\verify\cacert.pem"


完成上面操做再次在cmd环境中运行composer update 问题解决,参考文章

 http://blog.csdn.net/fjnjxr/article/details/54968072

 

我在安装的过程当中,即使是知足了以上要求,还出现了一个相似于下面的错误,最终排查,是php_fileinfo未开启致使的,在php.ini中将这个配置项的注释去掉便可

To enable extensions, verify that they are enabled in those .ini files: - X:\wamp\php\php.ini You can also run `php --ini` inside terminal to see which files are used by PH P in CLI mode.

来自:http://blog.csdn.net/u011120720/article/details/51983311

相关文章
相关标签/搜索