Search code examples
phpwindowswamp

How to upgrade PHP version in Windows?


I'm using the WAMP server (x64 in windows) and recently upgraded my PHP version by downloading and installing the files from Wamp Server Files

I configured apache and changed php.ini file for needed extensions and it's working very well.

When I go to localhost -> phpinfo (in WAMP Server), It shows me the version as 7.3.4 which means PHP upgrade is working on the server.

But, when I run php -v on CMD, I get the version as 7.0.10 (My previous version).

I tried these things

  • WAMP server tray icon (Right click) -> Change PHP CLI version -> 7.3.4
  • Adding PHP 7.3.4 path to the PATH variables (It's C:\wamp64\bin\php\php7.3.4)

But, still it does not work.

Then, I tried where php in CMD.

It gave me this result.

C:\wamp64\bin\php\php7.0.10\php.exe
C:\wamp64\bin\php\php7.3.4\php.exe

In PATH variables, there's C:\wamp64\bin\php\php7.3.4\php.exe which I added. But, there is no C:\wamp64\bin\php\php7.0.10\php.exe. Where does it come from?

If I could remove that, I think I could solve the problem.

Or is there any other way that I can solve the problem?


Solution

  • I finally found the way to fix the problem.

    In windows, there are two path variables.

    1. User PATH Variables
    2. System PATH Variables

    PHP 7.0.10 variable was in User PATH variables. Removing it fixed the problem.