1.下載安裝腳本 - composer-setup.php - 到當前目錄php
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
2.執行安裝過程composer
php composer-setup.php
3.刪除安裝腳本code
php -r "unlink('composer-setup.php');"
4.全局安裝date
sudo mv composer.phar /usr/local/bin/composer(ubuuntu:/usr/bin/composer) 注意:安裝以前必定保證php正確安裝(檢測:php -v查看版本號),保持composer版本更新命令:composer selfupdate