windows中wamp環境composer使用中openssl問題解決

來源:互聯網
上載者:User

標籤:detail   inf   環境   認證   nbsp   bsp   art   ret   設定   

今天在windows下學習lavaral,使用composer update命令報如下錯誤:

 

 [Composer\Exception\NoSslException]


  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.

 

大體意思就是composer要求使用openssl串連,百度相關問題,解決思路分為兩種:

 

一、禁用openssl,結果是治標不治本放棄

二、開啟php的openssl擴充,下載ca認證

 

具體操作如下:

 

 

1、開啟php擴充,左鍵wamp-php-php擴充-php_openssl前面打勾。

2、在D:\wamp\wamp\bin\php\php5.4.12(看個人安裝路徑確定)下找到php.ini檔案,用sublime開啟。

尋找 extension=php_openssl.dll ,刪除extension=php_openssl.dll前面的分號,取消注釋,從而啟用OpenSSL外掛程式。

注意:因為SSL串連需要認證,所以繼續下面的步驟之前,需要準備好CA認證(建議把認證儲存到D:\wamp\wamp\bin\php\php5.4.12\verify目錄中),可以從https://curl.haxx.se/docs/caextract.html處下載。(如果直接開啟檔案的話,另存新檔修改檔案名稱即可)

3、如果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.iniYou can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

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

windows中wamp環境composer使用中openssl問題解決

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.