PHP version switch doesn't always work

  • | 242 points

    I added PHP8 manually, and I'm sure I have the correct version for my OS. The PHP version switch worked perfect the first day that I installed Laragon, but today the version switch is a bit more difficult.

    I have checked my Windows 10 environment variables and I can see that only one PHP path is added at a time:

    At the moment, these are the steps that I have to follow to fix the PHP version switch:

    1. Switch PHP version in the Laragon System Tray Icon
    2. Click 'Tools > Path > Add Laragon To Path'
    3. Restart GitBash Terminal

    Is is possible to make this switchover easier? Maybe Laragon should update the path on each switch, or perhaps it's possible to have two PHP versions in the path at the same time?

    Also, the fact that I am using the GitBash terminal might have implications.

    Thanks for Laragon! I am moving away from Homestead now that I have found it.

  • | 16118 points

    @stuartcusackie the Cmder terminal can be launched from the Laragon menu, this terminal will respond to changes in PHP version.

    As you have written, to add Laragon to your paths (see > docs > isolated), just click Menu > Tools > PATH environment variable > Add Laragon to Path

    You then need to Log off and back on for the path to be added to all terminals (CMD/ Shell / Terminal / GitBash etc.)

    One point to note: if you change PHP version, you need to run Remove Laragon from Path, log off and back on. Then Add Laragon to Path log off and back on!

    The new PHP version will then be available in all terminals including GitBash.

Log in to reply

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