Fixing Valet Error: ‘Valet doesn’t support PHP version: php@8.2’

Fixing Valet Error: ‘Valet doesn’t support PHP version: [email protected]

If you’re a Laravel developer using Valet as your local development environment, you may encounter an error message like the following:

Valet doesn’t support PHP version: [email protected] (try something like ‘[email protected]’ instead)

This error message suggests that Valet doesn’t support the PHP version you’re trying to use. However, if you’re using the latest version of PHP and want to use it with Valet, there’s a simple solution you can try.

First, run the following commands:

composer global update
valet use [email protected]

These commands will update your global Composer packages and switch Valet to use PHP 8.2. If this fixes the issue, you’re good to go.

However, if you still get the same error message, it may be because you’re using an outdated version of Valet. Specifically, you may be using Valet v2 instead of the latest v3. To upgrade Valet to the latest version, you can run the following commands:

composer global require laravel/valet
valet use [email protected]
valet install

The first command will install the latest version of Valet globally, while the second command will switch to PHP 8.2. The third command will reinstall Valet and update it to the latest version.

After running these commands, you should be able to use Valet with PHP 8.2 without any issues. If you encounter any other issues or errors, you can refer to the Valet documentation or seek help from the Laravel community.

In summary, if you encounter the “Valet doesn’t support PHP version” error with Valet, you can try updating your Composer packages, switching to a supported PHP version, or upgrading to the latest version of Valet. These simple steps should help you resolve the issue and get back to coding with Laravel and Valet.


Leave a Reply