Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade php version on Windows 10

Tags:

I'm trying to get my Laravel project to work. But when I use composer update it says the following:

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

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

I've searched a bit around on google and I found out that it uses my windows PHP version instead of my webserver's version. But I couldn't find out how to update my PHP version on Windows.

My PATH contents are as shown in the following image

enter image description here

like image 555
ThomH Avatar asked Sep 09 '16 17:09

ThomH


People also ask

How do I upgrade PHP to 7.4 on Windows?

Download PHP 7.4 from the Official Website. In the first step, to install PHP 7.4 on Windows 10 Operating System, open your favorite web browser and navigate the official website of PHP. Next, download the 64 bit Non-Thread-Safe version of the PHP7 Installer zip file on your system.

Can I upgrade to PHP 8?

PHP 8: All You Need to Know to Upgrade. PHP 8 has been officially released for general users on November 26, 2020. This new update brings a number of powerful features and optimizations to the language.


2 Answers

You can uninstall composer, and while re-installing it will ask you to point at your PHP directory which is going to be C:\wamp64\bin\php (usually) at that point you can choose which PHP version you would want to use. good luck.

enter image description here

like image 115
Moe Ismail Alhakeem Avatar answered Oct 06 '22 00:10

Moe Ismail Alhakeem


This means you have yet another installation of PHP in your system. Check your Programs in Control Panel and remove such installation.

However, you can modify your PATH environment variable as well. Procedure

Just remove the path that points to any PHP installation directory.

Else, otherwise, if you are unsure about changing the PATH variable (which can lead to serious problems if not set well), you can just delete the directory that the PATH variable points to.... (I mean the PHP directory)

The totally better solution is to add the path of your PHP7 bin directory at the beginning of the PATH variable. You should also make available composer in this PHP7 bin directory.

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

like image 41
Huzaib Shafi Avatar answered Oct 06 '22 00:10

Huzaib Shafi