Composer更新显示错误的php版本

时间:2017-09-22 16:09:08

标签: php laravel xampp composer-php laravel-5.4

我已经使用PHP v3.2.27.0.21安装了XAMPP composer 1.5.1并在laravel version 5.4.36上构建了一个应用程序。

安装spatie/laravel-analytics软件包时遇到错误:

  Problem 1
- This package requires php >=7.0 but your PHP version (5.6.4) does not satisfy that
 requirement.
Problem 2
- Installation request for spatie/laravel-analytics ^3.1.0 -> satisfiable by
 spatie/laravel-analytics[3.1.0].
- spatie/laravel-analytics 3.1.0 requires php ^7.0 -> your PHP version (7.0.21) overridden 
by "config.platform.php" version (5.6.4) does not satisfy that requirement.

我有一句话:

    "require": {
    "php": ">=5.6.4",
     ................
    }

在我的composer.json文件上。从laracast上的帖子中读取我将“php”:“> = 5.6.4”更改为“php”:“> = 7.0”并运行命令composer dump-autoloadcomposer update 并收到错误消息:

 Problem 1
- This package requires php >=7.0 but your PHP version (5.6.4) does not satisfy that 
requirement.

如果有人能够指出导致此错误的原因及其可能的解决方案,我将非常感激。

1 个答案:

答案 0 :(得分:0)

重新安装composer并手动选择php7文件夹