Installing Composer – OpenSSL issue

If you have already WAMP (or XAMP) installed and you want to add composer in your system:
Either using command line: curl -sS https://getcomposer.org/installer | php
Or with windows installer you might see that composer is complaining about OpenSSL extension is not enabled in PHP.
If that’s the issue you are facing then this is how you fix it:

You might be confused why you are facing this issue because when you looked at PHP Extensions UI in Wamp the OpenSSL is already enabled.
That is because WAMP UI is linked to php.ini located at c:\wamp\bin\apache\Apache2.x.x\bin\php.ini however, composer is looking at a different php.ini.

So, head to WAMP installation directory and locate php.ini file in c:\wamp\bin\php\php5.x.x\php.ini open the file and search for ‘extension=php_openssl.dll’
Now uncomment the extension by removing semicolon at the beginning of the line and you should be able to install Composer without any issue.