6

I am trying to install composer however when I go to install it I get 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

I currently have php 5.4.31 and I am running WAMP2.2 I've checked my php.ini file in the bin/php/php5.4.31/ and ensured that the following line is uncommented:

extension=php_openssl.dll

The error still resolves and I'm at a loss as to how I can fix it. As I thought by uncommenting the line it would be enabled.

Also when I run this command in the terminal window php --ini I get the following message:

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\php_openssl.dll' - The specified module could not be found

peterh
  • 9,698
  • 15
  • 68
  • 87
Javacadabra
  • 5,117
  • 13
  • 73
  • 142
  • 1
    Be sure that the requested dll file is at the correct location. As you can see the error is that the file cannot be located. Also be sure that the apache server under the wamp is supporting ssl. – Athafoud Aug 11 '14 at 10:13
  • Possible duplicate of [PHP Startup: Unable to load dynamic library, Windows, Apache 2.2, php 5.2.11](http://stackoverflow.com/questions/1808442/php-startup-unable-to-load-dynamic-library-windows-apache-2-2-php-5-2-11) – jww Aug 12 '14 at 01:45

2 Answers2

25

If you are a windows user, make sure to uncomment this line in your php.ini file:

 extension_dir = "ext"

It makes sure that PHP is taking the extension from its own ext library.

DaveM
  • 549
  • 1
  • 5
  • 13
13

@Javacadabra, extensions like php_openssl.dll will be under php/ext/ directory, you could fix this path in the config file or you could copy that specific file from php/ext directory to php directory.

in your case it will be c:\php\ext

Arjun Vs
  • 352
  • 2
  • 4
  • I will accept this answer, composer installed but for some reason it's commands are not being recognized on the command line, im guessing this is also a path issue. – Javacadabra Aug 11 '14 at 10:23
  • @Javacadabra - [Adding directory to PATH Environment Variable in Windows](http://stackoverflow.com/questions/9546324/adding-directory-to-path-environment-variable-in-windows). – jww Aug 12 '14 at 01:58