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.

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

  1. Zeshan says:

    Brilliant! Strange even though `valet use` was showing php@7.4 correctly and some of the installations were using correct PHP version, some were using 8.1.1.

    Really strange. Your solution solved it. Thanks!

Leave a Reply

Your email address will not be published.