多版本php,在php7.2的环境下安装composer
-
需设置.composer 文件夹权限,须到安装项目路径下安装
-
注意 设计到php,都是跟着php7.2的安装配置路径走的;
-
下载命令: curl -sS https://getcomposer.org/installer | /usr/local/php7.2/bin/php
-
安装命令: sudo /usr/local/php7.2/bin/php composer.phar install
如果安装提示错误
Your requirements could not be resolved to an installable set of packages.
以上原因:不匹配composer.json要求的版本。
执行下面命令
composer install --ignore-platform-reqs
composer update --ignore-platform-reqs
执行过后再执行安装,可能会继续报错,但vendor文件夹已经生成了.