While i try to install composer.phar in my wamp server using command prompt i received below error in my cmd. Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you. I used composer while install Symfony2.
Command to install composer using cmd :
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
Error :
D:\wamp\www\server>php -r "eval('?>'.file_get_contents('https://getcomposer.org/ installer'));" PHP Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1 PHP Stack trace: PHP 1. {main}() Command line code:0 PHP 2. file_get_contents() Command line code:1 Warning: file_get_contents(): Unable to find the wrapper "https" - did you forge t to enable it when you configured PHP? in Command line code on line 1 Call Stack: 0.0059 116464 1. {main}() Command line code:0 0.0059 116856 2. file_get_contents() Command line code:1 PHP Warning: file_get_contents(https://getcomposer.org/installer): failed to op en stream: Invalid argument in Command line code on line 1 PHP Stack trace: PHP 1. {main}() Command line code:0 PHP 2. file_get_contents() Command line code:1 Warning: file_get_contents(https://getcomposer.org/installer): failed to open st ream: Invalid argument in Command line code on line 1 Call Stack: 0.0059 116464 1. {main}() Command line code:0 0.0059 116856 2. file_get_contents() Command line code:1
Solution :
Use http intend of https
So use below command :
php -r "eval('?>'.file_get_contents('http://getcomposer.org/installer'));"
You must see the the output like below :
Hope this helps!
Hi There,
I was having the same problem with you.
I’m using WAMP on windows 7, until finally I find the solution.
Steps:
1. Reinstall the Composer-Setup.exe
2. Setup the php.exe location to C:\wamp\bin\php\php5.3.13\php.exe
3. You need to make sure to uncommented the extension=php_openssl.dll at php.ini file in C:\wamp\bin\php\php5.3.13\ folder. If you setup the openssl via WAMP server menu PHP >> PHP Extention, it won’t affected to the php.exe
Hope this will work for you too.
Regards,
hendra