How to upgrade php version on Windows 10

I am trying to start a Laravel project. But when I use the update for the composer, he says the following:

This package requires php> = 5.6.4, but your version of PHP (5.5.12) does not satisfy this requirement.

I use WAMP, which runs php version 7.0.4, this is also confirmed in the browser if I repeat the php version. But when I use php -v in the console, it shows that I am using PHP version 5.5.12 (cli).

I searched a bit on google and I found out that it uses my version of PHP for Windows instead of my version of the web server. But I could not find out how to upgrade my version of PHP on Windows.

The contents of my PATH are shown in the following figure.

enter image description here

+8
source share
3 answers

You can remove composer, and when reinstalling it will ask you to specify the PHP directory, which will be C: \ wamp64 \ bin \ php (usually), at this point you can choose which version of PHP you want to use., Good luck.

enter image description here

+12
source

This means that you have another PHP installation on your system. Check Programs on the Control Panel and remove such an installation.

However, you can also change your PATH environment variable. Procedure

Just remove the path pointing to any PHP installation directory.

Otherwise, if you are not sure about changing the PATH variable (which can lead to serious problems if it is not set well), you can simply delete the directory where the PATH variable points to .... (I mean the PHP directory)

An absolutely best solution is to add the path to your PHP7 bin PHP7 at the beginning of the PATH variable. You must also make composer available in this PHP7 bin directory.

For example, replace C:\php in your path with C:\wamp\bin\php7 or whatever the location of PHP7 ..

+2
source

if you installed xampp / wampp and composer globally, you could add php to your environment path to call it anywhere, and now you want composer to use the new xampp with php recently installed by you, so go to system> tab "Advanced"> environment variable> maybe in "PATH", then find if you have something like C:\xampp\php and edit C:\xampp\php in your new location.

I had several versions from xampp for testing and composer globaly installed for php 7.2

0
source

All Articles