Loizos Vasileiou
Loizos Vasileiou

Reputation: 704

How to enable newer version of php to be default?

I'm trying to understand how to update my php version in my machine. On the CMD I tried getting the version as shown below. I believe this version was installed via XAMPP but now I have uninstalled this program. When I try to get the version again in the CMD it remains 7.2.26!

C:\Users\name>php -v
PHP 7.2.26 (cli) (built: Dec 17 2019 15:29:44) ( NTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

I have downloaded a new version, hoping that it would solve it (php v.7.4.8) and added it in C:\php directory (it is the only version available) but the cmd will still return version 7.2.26!

Note that when I open the C:\php\php.exe and run phpinfo(); the version is 7.4.8.

My question is how to completely remove php 7.2.26 from my machine. I cannot locate where it is installed!

Upvotes: 1

Views: 90

Answers (1)

gpl
gpl

Reputation: 1470

Change System Path variable of your computer which still points to the directory in which old version is installed.

  • Goto My Computer
  • Right Click, choose Properties
  • Select Advance System Settings
  • Goto Advanced tab
  • Click Environment Variables.
  • Double click on Path in the System Variables list
  • Remove old folder location from the Variable Value field and add new location.
  • Save Settings by clicking OKs

Upvotes: 1

Related Questions