2
votes

I have read How to enable PHP's openssl extension to install Composer? and You must enable the openssl extension to download files via https

They both state that the php file needs to uncomment extension=php_openssl.dll from the php.ini files which live in both these folders:

C:\wamp64\bin\apache\apache2.4.17
C:\wamp64\bin\php\php7.0.0
C:\wamp64\bin\php\php5.6.16          ' I don't think I need to, but did it any way

I've done that, and then restarted the PC.

WAMP is running on my Windows 10 machine

The same error always shows when trying to install Composer

Some settings on your machine make Composer unable to work properly. Make sure that you fix the issues listed below and run this script again:

The openssl extension is missing, which means that secure HTTPS transfers are impossible. If possible you should enable it or recompile php with --with-openssl

What do I need to do to install Composer?

Edit

From C:\PHP (the PHP folder) I started a command prompt and ran php -r "phpinfo();"

In the results, there is the following:

OpenSSL support => disabled (install ext/openssl)

I have followed http://php.net/manual/en/faq.installation.php#faq.installation.addtopath

1
make sure you're editing the correct .ini file, and dont forget to restart apache. maybe this will help: stackoverflow.com/a/14447063/2460773 - Nitsan Baleli
@NitsanBaleli, I'm not sure how the link you've kindly provided differs from the second file path in my post :s - MyDaftQuestions
Run php -r "phpinfo();" in the command line and make sure openssl is enabled. WAMP uses different php.ini file in console mode. If not you can find location of the used php.ini within the output of phpinfo call. - emix
hmm, @mike, it shows OpenSSL support => disabled (install ext/openssl).. I have done php.net/manual/en/… - MyDaftQuestions
@NitsanBaleli restarting Apache is not needed to change CLI settings as a new PHP instance is implicitly started on every CLI invocation. - Niels Keurentjes

1 Answers

0
votes

You have multiple version of PHP installed:

  1. C:\wamp64\bin\php\php7.0.0
  2. C:\wamp64\bin\php\php5.6.16
  3. C:\PHP

  • The PHP version, which you run on the CLI is based on your environment PATH variable. The first PHP path wins.
  • run php --ini on the CLI. It will show you which php.ini is included and also the path of PHP
    • edit this php.ini file and activate the extension=php_openssl.dll
  • then run php -m to check, if the extension is loaded
  • then run composer