先参考:
https://blog.csdn.net/benrciv/article/details/73478892
但是有两个问题:
1.csdn复制粘贴都带一大串版权声明……非常麻烦
2.校验码错误,第二步。
命令1. php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
命令2. php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
命令3. php composer-setup.php
命令4. php -r "unlink('composer-setup.php');"
以上就是安装composer的步骤,另外,我是在/usr/local/bin/下面执行的这些语句
所以就参考: