Reputation: 5814
I have downloaded two versions of PHP 5.6.35 and 7.1 set there environment variables but each time i run command to check versions
php -v
it gives 5.6
I need 7.0 for laravel packages but my wamp server requires 5.6.
i set the path variable of both . but when i use in project it give's eror
doctrine/inflector v1.2.0 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement
any help
Upvotes: 0
Views: 1012
Reputation: 941
You can install multiple versions of php in Windows. But you need to do the following every time you need a run a project which supports a specific PHP version:
Have a look at this answer on how to automate version change on Windows.
Upvotes: 1
Reputation: 772
You get 5.6, because it set in your PATH
system variable.
If you need an additional 7.0, you could download it and use full path to php.exe to execute it.
Example:
C:\php7\php.exe -v
Or you could change PATH
to php 7 directory. Then you will be able to run it with only php
command. In this case, to run php 5.6 you will have to use full path to it. Don't forget to logout/reboot the system to apply the PATH
variable changes.
Set only one version of php to PATH
because system runs the first founded php.exe, in your case this is php 5.6.
Upvotes: 3