zf2 error : enable the openssl extension

在經過以下命令:php

php composer.phar install

安裝ZF2框架的時候報錯:apache

You must enable the openssl extension to download files via https

而後我經過wamp桌面通知欄下的UI界面開啓了apache的ssl_module,以及在php.ini中開啓openssl:服務器

extension=php_openssl.dll

可是仍然報一樣的錯誤,非常納悶,最終在stackoverflow中找到了答案:composer

"WAMP uses different php.ini files in the CLI and for Apache. when you enable php_openssl through the WAMP UI, you enable it for Apache, not for the CLI. You need to modify C:\wamp\bin\php\php-X.Y.Z\php.ini to enable it for the CLI."

意思是說wamp在apache和CLI中使用不一樣的php.ini文件,當你經過wamp的UI界面開啓php_openssl的時候,其實你開啓的是針對apache的ssl,而不是針對CLI的,你須要去wamp安裝目錄下找到php所在的文件夾如C:\wamp\bin\php\php-X.Y.Z,而後在該文件夾下打開php.ini開啓(針對CLI的)php_openssl便可。框架

修改完成後重啓apache服務器就不會再報錯了。spa

相關文章
相關標籤/搜索