You must enable the openssl extension to download files via https

163,130

Solution 1

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.

Solution 2

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

Solution 3

make sure you have correct path to extension folder

extension_dir = "ext"

by default it is commented with ; character

Solution 4

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

Solution 5

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!

Share:
163,130
Uttam Dutta
Author by

Uttam Dutta

Updated on May 16, 2020

Comments

  • Uttam Dutta
    Uttam Dutta almost 4 years

    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?

  • Diego Favero
    Diego Favero over 10 years
    I also had to enable the phar extension ( extension=php_phar.dll ) and as said below, the apache ssl module !
  • George D.
    George D. over 10 years
    "PHP CLI SAPI is using different php.ini than CGI or Apache module." That was the trick!
  • Ruwantha
    Ruwantha over 10 years
    who would thought that... Really... This solved the problem. Thanks
  • totymedli
    totymedli over 10 years
    If you can't find that line in your php.ini just simply add the line extension=php_openssl.dll under the Dynamic Extensions part in it.
  • Shashikumar Misal
    Shashikumar Misal almost 10 years
    I am Using xampp, Composer giving the same open ssl missing error even after removing the ';' of openssl extension in php.ini.
  • Prabowo Murti
    Prabowo Murti over 9 years
    If you are using Mac and port, you can select the PHP version by port select php php55 and install the extension port install php55-openssl
  • im_brian_d
    im_brian_d over 9 years
    this line was commented out completely and now it works
  • ThaDafinser
    ThaDafinser about 9 years
    This is wrong. Check with phpinfo() which php.ini is used
  • haakym
    haakym about 8 years
    important for windows installation!
  • MyDaftQuestions
    MyDaftQuestions about 8 years
    Where is this line? In which file? the php.ini in 1, C:\wamp64\bin\apache OR 2. C:\wamp64\bin\php\php7.0.0 ?
  • Abhijit Kumbhar
    Abhijit Kumbhar over 7 years
    how to edit this settings in shared hosting like godaddy
  • BorisS
    BorisS over 7 years
    Try creating php.ini in your root folder as described here: stackoverflow.com/questions/16140917/…