PHP version in CLI is wrong even if PATH is right

  • | 1325 points

    I have latest Laragon installed and I added both PHP 5.6.33 and 7.1.12
    With the 7.1.12 version active, I added Laragon to PATH, and indedd I can see my 7.12 version in the PATH's list.
    I also restarted a couple of time as suggested by Laragon to be sure.
    But when I type "php -v" (no quotes) in a cmd shell, I get the PHP 5.6.33 version, and this prevents me form installing latest Laravel release

    Even if I remove Laragon from PATH (and restart), so that I have no PHP version in PATH, the "php -v" command still tells me that 5.6.33 is there: and I have no idea where it comes from! :-O

    Only when I delete the 5.6.33 folder, restart and add Laragon to PATH, then the right 7.1.12 is in my CLI; but soon as I restore the 5.6.33 folder, the CLI is back to 5.6.33 version... and this is driving me mad!

    Any idea, please? :-(

    EDIT: wait, there's more! If I type "php -v" from the classic cmd windows, I get the right 7.1.12 version! But when I use the bundled Terminal in Laragon I get the 5.6.33 version... :-O

  • administrators
    | 76787 points

    @ivanhalen : Did you switch to PHP 7.1.12 (click Menu > PHP > Version > xxx)?

  • | 1325 points

    Yes, I did at first...
    Anyway, after a couple of opening/closing Terminal and restart Windows, it worked :-)

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.