Home / Snippets / Laravel Valet Change PHP Version on MacOS
Laravel Valet Change PHP Version on MacOS cover

Laravel Valet Change PHP Version on MacOS

4.1K

2 years ago

0 comments

In this short snippet, you will learn how to make use of the Laravel Valet command.

Prerequisite


Install Homebrew package manager.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 1: Install Laravel Valet


Install Laravel Valet command line globally using the composer command line.
composer global require laravel/valet
Complete the valet installation with the "valet install".
valet install

Step 2: Install Multiple PHP Versions


By default, you might only have 1 PHP version and you can install the other PHP versions with Homebrew. First, search the available PHP versions.
brew search php
Next, install the other PHP versions using the brew command below.
brew install php

brew install [email protected]

brew install [email protected]

Step 3: Switch PHP Version


Now that you have all the other PHP versions you can easily switch PHP versions. If you want to switch to PHP version 7.3 you can use the command below.
valet use [email protected]
Then to change back to the latest version you can use the command below.
valet use php
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this