How to enable PHP's openssl extension to install Composer?

I am trying to install Laravel in WAMP setup. I am getting a warning message for not enabling openssl which I had already done in WAMP.

Here is a screenshot of the message.

enter image description here


Solution 1:

It is possible that WAMP and Composer are using different PHP installations. Composer will use the PHP set in the PATH environment variable.

If you want to enable the openssl extension to install Composer, first you need to check the location of the PHP installation.

  1. Open a Command Prompt, type: echo %PATH% then check for the location of your PHP installation.
  2. Go to that location and edit the file named: php.ini.
  3. Uncomment the line extension=php_openssl.dll by removing the semicolon at the beginning.

Now you are good to install Composer.

Solution 2:

I solved my problem a different way. The problem is that wamp's GUI was misleading: it claimed that I had php_openssl enabled.. and if I clicked on php.ini on the same GUI.. it actually showed that extension=php_openssl.dll was uncommented..

I'm not sure if i'm using the same installer version of composer of the OP, but it actually asks you at the beginning to specify the php.exe that you like to apply composer on (which basically ensures that no one tries to apply composer to the wrong php executable as what happened with the OP)..

The way I solved this was by going myself into the installation of php within the wamp package: C:\wamp\bin\php\php5.4.12 and looking php.in there.. when I opened it I was shocked that the line extension=php_openssl.dll was actually commented! I uncommented it and it worked just fine.

enter image description here

Solution 3:

I had the same problem and here the solution I found, on your php.ini you need to do some changes:

  1. extension_dir = "ext"
  2. extension = php_openssl.dll

Every one here talks active the openssl extension, but in windows you need to active the extension dir too.

Solution 4:

For WAMP server, comment given by "Enrique" solved my problem.

wamp is using this php.ini:

c:\wamp\bin\apache\Apache2.4.4\bin\php.ini

But composer is using PHP from CLI, and hence it's reading this file:

c:\wamp\bin\php\php5.4.12\php.ini (so you need to enable openssl there)

For composer you will have to enable extension in

c:\wamp\bin\php\php5.4.12\php.ini

Change:

;extension=php_openssl.dll 

to

extension=php_openssl.dll