2

When I tried to install composer on windows I received this error:

"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"

Anybody knows how I can resolve this kind of error ?

Also you should know I enabled ssl on apache server.

jww
  • 97,681
  • 90
  • 411
  • 885
Gegen Lebens
  • 21
  • 1
  • 2
  • Possible duplicate of [composer not install in windows 7](http://stackoverflow.com/questions/22763452/composer-not-install-in-windows-7) – jww Aug 19 '14 at 07:28
  • It could be possible your php is using another php.ini when used from the CLI. – Dennis Schepers Aug 19 '14 at 07:29
  • 1
    Thank you Dennis, you were right, I am using WAMP and it uses another php.ini that is deferent from one composer uses !!! – Gegen Lebens Aug 19 '14 at 07:33

5 Answers5

2

Try php -m in your CLI to check if openssl is listed. Then check your php.ini location with php --ini

You may be modifying the wrong php.ini.

TunaMaxx
  • 1,782
  • 12
  • 18
1

Another thing to check is that following lines should also be enabled.

include_path = ".;c:\php\includes"

extension_dir = "./"

extension_dir = "ext"

Also had the same problem which was solved.

Happy Composing :) :) :) :) :) :)

Community
  • 1
  • 1
malik
  • 11
  • 2
0

Enable openssl from all php.ini
;extension=php_openssl.dll => extension=php_openssl.dll

if you are using wamp then don'nt forget to restart all services after change in php.ini file

Aman Maurya
  • 1,305
  • 12
  • 26
-1

I have windows 10 with xampp 3.0.12 (php5.4). I was not able to install composer. I tried below steps it worked for me.

  1. download installer script from https://getcomposer.org/installer
  2. save it in a file called as composer-setup.php
  3. open composer-setup.php in vscode or subline code editor.
  4. replace all https to http and save file.
  5. execute below 3 steps in command prompt.

    php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

    php composer-setup.php

    php -r "unlink('composer-setup.php');"

  6. viola! successfully installed composer, you can run: php composer.phar.

Thanks

Inayath
  • 99
  • 9
-1

Just use - --disable-tls

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --disable-tls
php -r "unlink('composer-setup.php');"
RahulAN
  • 97
  • 1
  • 1
  • 7
  • Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in Command line code on line 1 Warning: copy(): Failed to enable crypto in Command line code on line 1 Warning: copy(https://getcomposer.org/installer): Failed to open stream: operation failed in Command line code on line 1 – Gie Aug 08 '22 at 09:07