Cannot enable openssl extension for Composer after trying everything for hours! =(

8k views Asked by At

When I try to use composer in command line, it keeps saying:

"[Composer\Exception\NoSslException] The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true."

I did hours of research and tried basically everything I found, including:
- uncommenting extension=php_openssl.dllandextension_dir = "ext"inphp.ini` in all my wamp and stand-alone php folders. I even did that to the phpforApache files.
- making composer use both my stand-alone php AND wamp php (both ver 7.0)
- ticking ssl_module in wamp Apache modules and php_openssl in PHP extensions
- I checked. php_openssl.dll DOES exist in the /ext directory
- I checked and the extension in php.ini does lead to the right directory: extension_dir ="c:/wamp64/bin/php/php7.0.10/ext/"
- Copying libeay32.dll and ssleay32.dll from installdir/php/ to installdir/apache2/bin/
- reinstalling composer and wamp

What else can I possibly do?? I am pretty desperate now. I tried disabling tls but after that it banned me from connecting: " [Composer\Downloader\TransportException] Your configuration does not allow connections to http://packagist.org/packages.json. See https://getcomposer.org/do c/06-config.md#secure-http for details."

Help! Any insight would be appreciated

1

There are 1 answers

1
Ariful Islam On

Try this

 composer config -g -- disable-tls true

or you may update your php version to php 7.x