当前位置:   article > 正文

thinkphp5.0 composer 安装oss提示php版本异常_compser require php 版本不正确

compser require php 版本不正确

场景复现:

本地 phpstudy 环境,安装的有7.0到7.3三个版本,首先确认composer已经安装

composer安装阿里云oss的命令为:composer require aliyuncs/oss-sdk-php

运行报错:

  1. Problem 1
  2. - Root composer.json requires php ^7.2.5 but your php version (7.0.3) does not satisfy that requirement.
  3. Problem 2
  4. - gonoware/laravel-maps is locked to version v1.3.1 and an update of this package was not requested.
  5. - 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命令,完美运行。

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/184031?site
推荐阅读
相关标签
  

闽ICP备14008679号