Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Composer fails with "The openssl extension is missing" error

I'm attempting to install Composer but I get the following 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"

I have then gone into my php.ini-production and uncommented: "extension=php_openssl.dll"

This still doesn't work though, is there something else I have to do?

like image 256
keynesiancross Avatar asked Aug 01 '14 00:08

keynesiancross


2 Answers

If you are using MAMP on Windows, you need to change the extension for php.ini-development to php.ini Then, paste this line ;extension_dir = "ext" into the php.ini file, before the first extension appear, and uncomment this other line ;extension=php_openssl.dll removing the prefixed semicolon. Dont't forget to restart apache

like image 152
Fabricio Vargas Avatar answered Oct 06 '22 21:10

Fabricio Vargas


I suspect "php.ini-production" is a dummy configuration file suitable for live environments. Do a php -i at the console and find the 'php.ini' path, to see where it is expecting the ini file to be kept. This is normally expecting "php.ini", and may not actually exist - if it does not, copy php.ini-development (or similar) to the location required.

This is near the top of (a very long) output, so you may find redirecting it to a file helpful (php -i > C:\phpinfo.txt).

like image 29
halfer Avatar answered Oct 06 '22 22:10

halfer