This is a temporary workouround that allows me to go on with the local development with Laravel + Valet + PHP7.4
Today I upgraded my PHP to 7.4.0 version.
I have a MacBook Pro and I use PHP installed via Homebrew.
The usual step are:
brew update
brew upgrade php
composer global update
valet install
After "valet install" I had a problem: Unable to determine linked PHP when parsing '7.4'
This happens because the current version of Valet are not whistelisting PHP 7.4.
I jumped on
code ~/.composer/vendor/laravel/valet/cli/Valet/Brew.php
class Brew
{
const SUPPORTED_PHP_VERSIONS = [
'php',
'php@7.3',
'php@7.2',
'php@7.1',
'php@7.0',
'php@5.6',
'php73',
'php72',
'php71',
'php70',
'php56'
];
I added 'php@7.4', line:
class Brew
{
const SUPPORTED_PHP_VERSIONS = [
'php',
'php@7.4',
'php@7.3',
'php@7.2',
'php@7.1',
'php@7.0',
'php@5.6',
'php73',
'php72',
'php71',
'php70',
'php56'
];
I needed to do this workaround, until Valet will include php@7.4
Brew.php
Obviously this is not the official way to have php7.4 but, for me at the moment is working so it allows me to go on with Laravel development on php7.4 via Valet (at least for this weekend).
Top comments (3)
Laravel Valet added support to php 7.4 on version: v2.5.4: github.com/laravel/valet/releases/...
I wrote instructions on how to switch between PHP versions in Laravel Valet: gist.github.com/bgarrant/b9a2f7fb8...
Thank you. This was perfect.