How to install a new Laravel project in Valet using a specific PHP version?

552 Views Asked by At

I know that you can set a specific PHP version to a directory by using the valet isolate [email protected] but I'm not sure how to then install (for example) a Laravel 5.1 project using that specific PHP version.

I know the first reaction will be "just upgrade to a newer version of Laravel", but I've got an old legacy project that I need to get working on the Valet platform. My old MacBook died and the Laravel Homestead platform won't run on my new M1 MacBook.

1

There are 1 best solutions below

0
hihihahahahahihi On

Install the required PHP version using Homebrew. For example, if you want to use PHP 7.4, run:

brew install [email protected]

Once the PHP version is installed, switch to it using the following command:

valet use [email protected]