Downgrade PHP version in MAC Os

Shamshad Zaheer
Dec 16, 2020

Recently I upgraded my Mac OS and the new OS was having PHP version 8.0 by default.

I had my previous Laravel Project and wanted to browse it, but due its version the project was showing errors. I needed to downgrade my PHP to version 7.3.

Install PHP Version. 7.3
Open your terminal and type the following code to install php version 7.3

brew install php@7.3

Once I was done with installing php version 7.3 I unlink my current php and link the new installed php.

brew unlink php@8.0

Then I did link my new installed php version by entering following command in my terminal.

brew link php@7.3

Handling new installed php version in the valet

valet use php@7.3

rm ~!/.config/valet/valet.sock

valet restart