Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alev's avatar
Level 4

issues with Laravel Valet when installing old PHP version

For testing purposes I installed an old version of PHP (7.1). through brew.

Then I ran valet use [email protected] which worked.

But then I wanted to switch back to PHP 7.4 by using valet use [email protected] and got the following error.

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.9". You are running 7.1.33. in /Users/example/.composer/vendor/composer/platform_check.php on line 24

Then I tried to reset the Valet installation by running composer global update and valet install, or running composer global update and valet uninstall --force

But nothing worked.

When running composer global update I got the following error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/installer[v3.0.0, ..., v3.0.1] require php ^7.2 -> your php version (7.1.33) does not satisfy that requirement.
    - laravel/installer[v3.1.0, ..., v3.2.0] require php ^7.2.9 -> your php version (7.1.33) does not satisfy that requirement.
    - Root composer.json requires laravel/installer ^3.0 -> satisfiable by laravel/installer[v3.0.0, v3.0.1, v3.1.0, v3.2.0].

Now I even get an error when trying to force uninstall Valet with valet uninstall --force:

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.9". You are running 7.1.33. in /Users/example/.composer/vendor/composer/platform_check.php on line 24

I'm stuck. What can I do?

0 likes
10 replies
alev's avatar
alev
OP
Best Answer
Level 4

This article helped me fixing the issue: https://freek.dev/1185-easily-switch-php-versions-in-laravel-valet

Specifically the following command sequence:

valet stop
brew unlink [email protected] [email protected] [email protected] [email protected] [email protected]
brew link --force --overwrite [email protected]
brew services start [email protected]
composer global update
rm -f ~/.config/valet/valet.sock
valet install
12 likes
Tray2's avatar

If you solved it please mark the solution as best.

2 likes
MagicBob's avatar

I'm facing the same issue, but when I run valet stop I get the same error:

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". You are running 7.2.34. in /Users/bob/.composer/vendor/composer/platform_check.php on line 24

any ideas?

Vheekey's avatar

I had this same issue and got the same error when I followed @alev 's process sequentially but tweaking it a bit helped. So I followed @alev 's recommendation but in this order:

brew unlink [email protected] [email protected] [email protected] [email protected] [email protected] (first stopped the PHP causing the issue then the others)

valet stop

brew link --force --overwrite [email protected]

brew services start [email protected]

composer global update

rm -f ~/.config/valet/valet.sock

valet install

It worked!

5 likes
gegejosper's avatar

The solution is good provided here. Just update your composer to 1 instead of 2

poing's avatar

Just ran into a similar issue.

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.x". You are running 7.3.x. in /Users/example/.composer/vendor/composer/platform_check.php on line 24

I tried a number of things. 8.1 was running, was the local version, but kept getting the error.

bash-3.2$ valet use 8.1
Valet is already using version: [email protected]. To re-link and re-configure use the --force parameter.

The solution was --force, notice "Stopping [email protected]..." below.

bash-3.2$ valet use 8.1 --force
Unlinking current version: [email protected]
Linking new version: [email protected]
Stopping php...
Stopping [email protected]...
Installing and configuring phpfpm...
Updating PHP configuration for [email protected]...
Restarting [email protected]...
Restarting nginx...
Valet is now using [email protected].

Please or to participate in this conversation.