[SOLVED] Switch of php versions not working on mac
Since I had to face this issue as well, let me share how to make this work. If you have to switch back and forth on mac then this is what works for me.
Let’s say you have multiple PHP versions installed 7.2 and 7.4
Now my current PHP version is 7.4 & I have to switch back to 7.2, steps will be.
brew unlink php@7.4 && brew link php@7.2 --force
nano ~/.zshrc -> Update Export Path From 7.4 to 7.2
3. Save It.
4. brew services stop php@7.4
5. brew services start php@7.2
Voila. To go back to 7.4 Run brew unlink php@7.2 && brew link php@7.4 --force
& uncomment export files. That's it.
references: https://stackoverflow.com/questions/59142504/switch-of-php-versions-not-working-on-mac