Trouble with PHP versions after migrating to an M1 Macbook

I migrated a Time Machine backup from a 2015 Intel High Sierra to a 2021 M1 Monterey. I love the computer, and the migration was largely a success.

I use Laravel Valet to run and develop local websites. They break every time I restart the new machine. php -v from Terminal always returns 8.0, but calling phpInfo(); from one of the local sites reveals PHP 7.2.34 is running and none of the sites can find MySQL.

If I run valet use [email protected], I get: Valet is already using version: [email protected]. To re-link and re-configure use the --force parameter.

Then I run valet use [email protected] --force and I get this output:

Unlinking current version: [email protected]
Linking new version: [email protected]
Updating PHP configuration...
Restarting [email protected]
Restarting nginx...
Valet is now using [email protected]

And I’m fine until I reboot the machine again.

What’s broken?

I suspect this has something to do with having to install a different version of homebrew for the M1 processor architecture and the old version of homebrew still existing because of the migration, but I don’t understand what is happening.

Things I’ve Tried

  • valet install
    Updating valet does not fix this problem.

Leave a comment

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