0

I've installed XAMPP v3.2.2 with PHP 7.0.21 and composer 1.5.1 and building an application on laravel version 5.4.36.

While installing spatie/laravel-analytics package i'm getting error:

  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.

I had a line:

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

on my composer.json file. Reading from a post on laracast I changed "php": ">=5.6.4" to "php": ">=7.0" and ran command composer dump-autoload and composer update and getting the error message:

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

I would be very thankful if anyone could point out what is causing this error and its possible solution.

psudo
  • 1,341
  • 3
  • 24
  • 69
  • Obviously you have installed PHP 5.6 – Kyslik Sep 22 '17 at 16:12
  • run `php -v` to get your current version. – cre8 Sep 22 '17 at 16:18
  • Output of php -v `PHP 7.0.21 (cli) (built: Jul 5 2017 13:31:19) ( ZTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies` – psudo Sep 22 '17 at 16:19
  • Sounds like there is a system root definition variable stuck with the 5.6.x version in it. Check your Apache server to see if it recognizes the PHP version correctly, verify any Configuration files have the appropriate PHP Version stated, as well. – GoldBishop Sep 22 '17 at 17:16
  • @GoldBishop How do I check PHP version from apache server ? – psudo Sep 22 '17 at 17:47
  • All i know is how Apache behaves on Windows Servers....sometimes the Path variables clog up the versioning system...were PHP reports one version (`php -v`) and Apache will report another (`phpversion()`). – GoldBishop Sep 22 '17 at 17:51

1 Answers1

0

Reinstall composer and select manually php7 folder

the_hasanov
  • 782
  • 7
  • 15