keynesiancross
keynesiancross

Reputation: 3529

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?

Upvotes: 11

Views: 35891

Answers (6)

Fabricio Vargas
Fabricio Vargas

Reputation: 51

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

Upvotes: 5

olasammy
olasammy

Reputation: 7366

You will also need to uncomment the extension dir. For example, find this line in your php.ini file:

;extension_dir = "ext"

Remove the semi-colon in front and save the file. I am sure this will work.

Remember to open your php.ini Administrator mode

Upvotes: 3

automatix
automatix

Reputation: 14532

Make a php.ini (e.g. from php.ini-production), open it in an editor as admin (!), remove the commenting semicolon ; in front of extension=php_openssl.dll, set the extension_dir correctly, and save the file. After that it should be working. But once again: open and edit the php.ini as admin.

Upvotes: 3

MarkWhite
MarkWhite

Reputation: 11

in WAMPserver edit this files:

D:\wamp\bin\php\php5.3.10\php.ini

or

D:\wamp\bin\php\php5.4.12\php.ini (based on version)

Do not use the php.ini in the WAMP server menu. It will not work. Go to the root of your wamp and as indicated above with D as root.

Upvotes: 1

halfer
halfer

Reputation: 20430

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).

Upvotes: 3

Thomas Edison
Thomas Edison

Reputation: 96

After changing anything in php.ini you have to restart your server, make sure you did so first of all.

Upvotes: 1

Related Questions