Upgrade PHP on Laravel Valet

Feb 28, 2020 1 minute read

The first step in the upgrade process is to upgrade your homebrew php instance

First update homebrew

1brew update

Next upgrade your version of php

1brew upgrade php

Next update your global composer instance

1composer global update

Install Valet

1valet install

Finally tell Valet to use your new version of php. At the time of writing this, we're using PHP 7.4

1valet use php@7.4

That's it. Your version of php on Laravel Valet should be updated. You can check by typing php -v

1PHP 7.4.4 (cli) (built: Mar 19 2020 20:12:27) ( NTS )
2Copyright (c) The PHP Group
3Zend Engine v3.4.0, Copyright (c) Zend Technologies
4 with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies