按照既有思维,composer是支持命令更新的,就是使用composer self-update
但是却给我提示
`SHA384 is not supported by your openssl extension, could not verify the phar file integrity
`
看提示来说就是因为没有能验证phar的合法性,此路不通那就去官方文档去找一个处理方式吧.
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
下载最新安装包
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
检查下载文件的哈希值
php composer-setup.php
确认安装成功
php -r "unlink('composer-setup.php');"移除链接
mv ./composer-setup.php /usr/local/bin/composer
移动到环境中