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!