The openssl extension is required for SSL/TLS when installed Composer via Scoop

10.7k Views Asked by At

I've installed PHP and Composer via scoop, but it fails with error that SSL is missing:

>scoop install php composer
...
>composer selfupdate
composer: 1.6.5 (latest version)
  [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.

What's missing?

1

There are 1 best solutions below

1
On

OpenSSL extension isn't enable by default when PHP has been installed via Scoop.

To enable it, extension=openssl needs to be commented in the existing php.ini file, or new .ini file can be created in PHP's conf.d directory.

The following command can locate php.ini:

php -i | grep -w ini

Then the following commands should solve the issue:

cd %HOMEPATH%\scoop\apps\php\current\cli\conf.d
echo extension=openssl >> openssl.ini

Respectively, similar files can be created for other extensions (such as mbstring, mysqli, etc.).

Related: PHP/Composer issue (missing OpenSSL extension).