4

While installing Composer for PHP, I get the following message:

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

How to fix this problem?

4 Answers4

17

@RiggsFolly has the right idea.

Additionally I had to:

  1. Copy php.ini-development to php.ini
  2. Uncomment the extension=php_openssl.dll line as described
  3. Uncomment this line: extension_dir = "ext"
  4. Make sure you find php_openssl.dll within that extension directory of course
runamok
  • 271
2

If you've installed directly from php.net's executable files for windows, the installation has no active php.ini file! You can confirm this using php -ini command in your console, it says C:\Windows which actually has no ini file.

You should first rename one of php.ini-development or php.ini-production to php.ini and then uncomment the extension. (i.e. removeing semicolon before the extension=php_openssl.dll in that file.)

ptvty
  • 141
1

I tried setting the environment variable, without luck.. I did however try installing the Windows Binary from https://slproweb.com/products/Win32OpenSSL.html and it started working immediately (using Xampp, if that makes a difference..)

thphoenix
  • 111
0

All you need to do is activate the openssl extension in your php.ini by removing the ; comment from the line

;extension=php_openssl.dll

To

extension=php_openssl.dll

Warning, there are usually 2 php.ini files, one in the apache\bin folder and one in the \php folder, edit the one in the \php\php.ini folder as this is the one that controls PHP CLI.