composer: Composer installer corrupt

I am trying to install composer for my laravel project using putty. I copied this code from composer website .

The code i copied is

php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'a52be7b8724e47499b039d53415953cc3d5b459b9d9c0308301f867921c19efc623b81dfef8fc2be194a5cf56945d223') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

But i get the error of

Installer corrupt.

What can i do to resolve this error?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 15 (4 by maintainers)

Most upvoted comments

the timeout solution for me was a hint @Seldaek sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf" become priority ipv4 more than ipv6

@Hybrid-ghost looks like you’re missing the phar PHP extension. Make sure it’s enabled.

Hello everyone, I have a similar problem to install and I do not know what the solution is? Somebody could help me. Below is detailed;

win10_@Anonymous /cygdrive/c/wamp/www composer create-project symfony/framework-standard-edition cursoweb/ “3.4.*”

I get this:

PHP Fatal error: Uncaught Error: Class ‘Phar’ not found in /cygdrive/c/ProgramData/ComposerSetup/bin/composer.phar:23 Stack trace: #0 {main} thrown in /cygdrive/c/ProgramData/ComposerSetup/bin/composer.phar on line 23

And in composer.phar the line says this:

Linea 23 Phar::mapPhar(‘composer.phar’); Linea 24 require ‘phar://composer.phar/bin/composer’;

What would be the solution? Regards,

@jhonmike, a million of thanks!

Thank you @jhonmike. That was helpful.

@jhonmike Great, this hack worked for me as well! Thanks.

@jhonmike thanks that worked for me!