You must enable the openssl extension to download files via https

I wanted to install Zend Framework 2. So I downloaded the skeleton application. As mentioned in the ZF2 manual, we have to issue the command

php composer.phar install

Inside the skeleton.

But I'm getting an error

You must enable the openssl extension to download files via https

Then I enabled the ssl_module in my wamp, I checked the php_ini file and I can see the following line

extension=php_openssl.dll

Still I'm getting the same error. Anybody having any clue what I missed out?

180569 次浏览

PHP CLI SAPI is using different php.ini than CGI or Apache module.

Find line ;extension=php_openssl.dll in wamp/bin/php/php#.#.##/php.ini and uncomment it by removing the semicolon (;) from the beginning of the line.

Uttam, if your issue is not solved then try the follwoing 3 step approach. It worked for me as I had exactly same issue.

step1: click on wamp tray icon.

step2: goto menu apache->apache modules

step3: click on menu item "ssl_module"

it will automatically restart wamp. if wamp not restarted automatically then restart it through wamp tray menu-> Restart All services. After restart confirm that "ssl_module" coming as ticked under menu apache->apache modules

after that just attempt the php composer.phar install from going through the response shared by you, php.ini file contains extension=php_openssl.dll and the php/ext directory also have file "php_openssl.dll"

good luck

I have faced this problem, but configuging openssl (also for cli) did not help.

I have updated composer and this sloved my problem.

Just type:

$ php composer.phar self-update

or

$ composer selfupdate

Good luck!

Verify you are editing the correct php.ini file.

Reference: https://github.com/composer/composer/issues/1440

"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."

Make sure that you update your php.ini for CLI. For my case this was C:\wamp\bin\php\php5.4.3\php.ini and uncomment extension=php_openssl.dll line.

I also had the same issue while playing around Zend Framework 2 and composer. I'm using PHP 5.4 (installed via macports) and my solution was to install openssl for PHP 5.4 via macports as well.

sudo port install php54-openssl

The Valery's answer helped me: https://stackoverflow.com/a/14265815/492457

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-5.4.3\php.ini to enable it for the CLI.

make sure you have correct path to extension folder

extension_dir = "ext"

by default it is commented with ; character

I use XAMPP. In C:\xampp\php\php.ini, the entry for openssl did not exist, so I added "extension=php_openssl.dll" on line 989, and composer worked.

Late answer but adding so other can learn the reason.

You also need to edit the php.ini file in the "wamp\bin\php\php-X.Y.Z" location.

You need to enable "extension=php_openssl.dll" in both files (php and apache). my pc files path are these :

  1. C:\wamp\bin\php\php5.3.13\php.ini

  2. C:\wamp\bin\apache\apache2.2.22\bin\php.ini

I had to uncomment extension=openssl in php.ini file for everything to work!

Becareful if you are using wamp don't use the wamp ui to enable the extension=php_openssl.dll

just go to your php directory , for example : C:\wamp\bin\php\php5.4.12 and edit the php.ini and uncomment the extension=php_openssl.dll.

it should work.

Was facing this error

"You must enable the openssl extension in your php.ini to load information from.."

I solved by finding and uncommenting the following lines on php.ini file

;extension=php_openssl
;extension_dir = "/c:\wamp64\bin\php\php 8.0.25\ext\/"
;extension=bz2
;extension=curl
;extension=fileinfo
;extension=gd
;extension=gettext
;extension=gmp
;extension=intl
;extension=imap
;extension=ldap
;extension=mbstring
;extension=exif
;extension=pdo_sqlite
;extension=shmop

in

Wamp/bin/php/php 8.0.25/php.ini

Uncomment both by removing the semicolon (;) from the beginning of each line.

Create jar with classpath dependecies in manifest

task createJar(type: Jar) {
println("Cleaning...")
clean
manifest {
attributes('Main-Class': 'com.abc.gradle.hello.App',
'Class-Path': configurations.default.collect { 'dependencies/' +
it.getName() }.join(' ')
)
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
} with jar
println "${outputJar} created"
}

If you have the latest PHP v^8 or above, likely you won't see php.ini file. So what you do is to make a copy of php.ini-development which you will see there and then rename the copy you just made to php.ini and then do the same uncommenting of the two lines then save.