search

Home  >  Q&A  >  body text

php - Installing composer on centos failed

The installation of composer on the server always fails. It seems that the verification fails. I don’t know how to solve it. I followed the official documentation and the process is as follows:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php

The execution fails after reaching this point, and the following error is reported

Downloading...
Signature mismatch, could not verify the phar file integrity
Retrying...

After a while the error message changes to the following

Downloading...
Signature mismatch, could not verify the phar file integrity
Retrying...
The "https://getcomposer.org/download/1.4.1/composer .phar" file could not be downloaded: >failed to open stream: HTTP request failed!
Retrying...
Signature mismatch, could not verify the phar file integrity
The download failed repeatedly, aborting.

Then it stopped. So helpless, I tried many times but still the same thing.
I can directly download the executable file (composer.phar) and it can be executed, but it seems that it cannot be installed globally, so I still want to execute it successfully according to the method in the document. I don’t know how I can solve it!

过去多啦不再A梦过去多啦不再A梦2752 days ago1045

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-05-16 13:03:13

    Download composer

    wget https://getcomposer.org/composer.phar

    Installation

    cp composer.phar /usr/local/bin/composer
    chmod u+x /usr/local/bin/composer

    Test

    composer --help

    Use root user when installing, use non-root user when using it

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 13:03:13

    Just install it manually

    reply
    0
  • Cancelreply