Home  >  Article  >  Development Tools  >  What to do if composer installation error occurs

What to do if composer installation error occurs

藏色散人
藏色散人Original
2019-08-10 13:52:254717browse

What to do if composer installation error occurs

composesr installation error: Installer corrupt

The reason for this problem is https protocol

Solution:

1. First download composer-setup.php in your current directory

Enter in the terminal:

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

2. Install composer into your bin path (so you can use it globally)

Enter in the terminal:

php composer-setup.php --install-dir=/usr/local/bin --filename=composer

3. Cancel the link to that composer

Enter in the terminal :

php -r "unlink('composer-setup.php');"

At this time, the composer-setup.php file is gone

4. Check whether composer is installed successfully

Enter in the terminal:

composer -v

Okay, let’s start your composer journey

For more composer usage tutorials, please visit the composer command usage graphic tutorial column!

The above is the detailed content of What to do if composer installation error occurs. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:what does composer doNext article:what does composer do