Resolving OpenSSL Extension Issue in Composer Installation
The Problem
If you have already WAMP (or XAMPP) installed and you want to add Composer in your system, you might encounter an OpenSSL extension error. This can happen when:
- Using command line:
curl -sS https://getcomposer.org/installer | php
- Using the Windows installer
Understanding the Issue
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.
This 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 file.
The Solution
- Navigate to your WAMP installation directory
- Locate the php.ini file in
c:\wamp\bin\php\php5.x.x\php.ini
- Open the file and search for
extension=php_openssl.dll
- Uncomment the extension by removing the semicolon at the beginning of the line
- Save the file
After making these changes, you should be able to install Composer without any issues.