Mac OSX – Laravel with Valet keep using wrong PHP version (8) instead of 7.4

Recently I have interesting problem with Valet using wrong PHP version on my Laravel application, trying to switch it from terminal not fix issue and stating it’s already done even including force relink.

valet use php@7.4 –force
Unlinking current version: php@7.4
Linking new version: php@7.4
Updating PHP configuration…
Restarting php@7.4…
Restarting nginx…
Valet is now using php@7.4.

Solution for this problem was using following command

rm ~/.config/valet/valet.sock

valet use php@7.4 –force

After that Valet use correct PHP version in my application.

Leave a Reply

Your email address will not be published. Required fields are marked *