场景复现:
本地 phpstudy 环境,安装的有7.0到7.3三个版本,首先确认composer已经安装
composer安装阿里云oss的命令为:composer require aliyuncs/oss-sdk-php
运行报错:
Problem 1
- Root composer.json requires php ^7.2.5 but your php version (7.0.3) does not satisfy that requirement.
Problem 2
- gonoware/laravel-maps is locked to version v1.3.1 and an update of this package was not requested.
- gonoware/laravel-maps v1.3.1 requires php ^7.2|^7.2.5 -> your php version (7.0.3) does not satisfy that requirement.
但是我查了本地项目运行环境的确是7.3,后来察觉可能是环境变量问题,结果一查果然环境变量指定的php是7.0目录,修改为7.3
关闭cmd,重新打开cmd面板,切换至项目根目录,执行composer命令,完美运行。