0

I've installed two xampp in different drives(windows) as follow:

Drive G: xampp (php 5.6)
Drive C: xampp (php 7.2)

I've also set environmental variable to php 7 drive in PATH variable. But still getting error during installing latest laravel that:

This package requires php >=7.0.0 but your PHP version (5.6.35) does not satisfy that requirement.

When I run following command in CMD it also shows php 5.6.3:

php -v

System is restarted, CMD is restared, what else I missed or have to do so that I can get latest PHP version? The strange thing is that when I run php file in xampp with 7 version it shows PHP 7.2.4 in phpinfo().

Note: I do need php 5.6 for other old projects that's why I can't delete second xampp.

enter image description here

Umair Malik
  • 1,403
  • 3
  • 30
  • 59

2 Answers2

1

I am not sure which windows you are using but as i think it is window 10

Make Sure you are adding PATH in your case C:\xampp\php in system variables instead of user variables

and try to run ECHO %PATH% in cmd and check if there is path added for PHP 7 not 5.6

Amit Bisht
  • 329
  • 3
  • 15
  • yes it's window 10, and I checked by running command in cmd as you said, it's pointing to G:\xampp\php; which is php 5. how can i change it? – Umair Malik May 02 '18 at 11:25
  • great man thanks, you were right i was adding PATH in user variable. Should I remove it from user variable now? or it's required to be added there too? – Umair Malik May 02 '18 at 11:27
  • may be in path G:\xampp\php added as i not used windows 10 but first search G:\xampp\php and replace it with C:\xampp\php – Amit Bisht May 02 '18 at 11:28
0

If your using linux just update your default php

sudo update-alternatives --set php /usr/bin/php7.2

If your using any other operating system then check how to set default version.

For windows:

Download php from http://php.net/downloads.php and extract it to C:\xampp\php7.2 and set this path.

Jagadesha NH
  • 2,529
  • 2
  • 23
  • 41