0

I tried to install composer like:

curl -sS https://getcomposer.org/installer | php

It returns me an error:

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 despite on the extension OpenSSL is enabled in PHP.

I can see that in phpinfo():

PHP Version 5.6.30

OpenSSL support enabled
OpenSSL Library Version LibreSSL 2.2.7
OpenSSL Header Version  LibreSSL 2.2.7
Openssl default config  /private/etc/ssl/openssl.cnf

How to fix this issue?

Garama
  • 11
  • 3

1 Answers1

-1

You can disable ssl verification by adding -k.

curl -ksS https://getcomposer.org/installer | php
abeyaz
  • 3,034
  • 1
  • 16
  • 20
  • The same 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` – Garama May 01 '17 at 14:27
  • Which phpinfo is that you posted? cli? fpm? mod_php? Openssl must be enabled in `cli`. – abeyaz May 01 '17 at 14:29
  • Can you explain how to enable with cli? – Garama May 01 '17 at 15:01
  • I use MAMP Web Server, Mac OS Sierra – Garama May 01 '17 at 15:02
  • If you run this code from mac console/shell, it means php cli executes it. Can you also run this in the console and share the output `php -r "phpinfo();" | grep "openssl"` – abeyaz May 01 '17 at 15:18
  • I get this: `OpenSSL support => disabled (install ext/openssl)` – Garama May 01 '17 at 15:19
  • Lookse like openssl is not properly installed or configured. Check this post for the same problem http://stackoverflow.com/questions/18137408/cant-run-composer-on-my-mac-mountain-lion-openssl-extension – abeyaz May 01 '17 at 15:20
  • But `phpinfo` tells that it is enabled – Garama May 01 '17 at 15:20
  • The phpinfo you are checking in the browser, is not the one for `cli` package. It is for your web server. – abeyaz May 01 '17 at 15:21
  • I tried this, I have 7 version PHP, not 5. Also I get error: `sudo: port: command not found` – Garama May 01 '17 at 15:21
  • Can you run `php -r "phpinfo();" | grep php.ini` to find the php.ini path, and then check that file for openssl extension if it is active etc.. – abeyaz May 01 '17 at 15:23
  • It gives me `Configuration File (php.ini) Path => /usr/local/lib` what next? – Garama May 01 '17 at 15:26
  • Here there is not extension openssl – Garama May 01 '17 at 15:27
  • There has to be a `php.ini` file there, did you find it ? – abeyaz May 01 '17 at 15:27
  • turning off SSL does not fix the issue, as even if you get that to work, when you try to install composer packages you'll need SSL to work or you will continue to have errors – pilavdzice Mar 05 '19 at 21:52