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

wonder95's avatar

Unable to use PHP 8.3 with Laravel 11 and Valet 4.3.0

In a Laravel 11 app using Valet 4.3.0, with PHP 8.3 installed via Homebrew, and both php -v and php-fpm -v show PHP 8.3.10. In homebrew, I previously had [email protected] and php (v8.3) installed, and valet for some reason was using PHP 8.3.

When running valet use [email protected], I get an error Valet doesn't support PHP version: [email protected] (try something like '[email protected]' instead). I have tried these steps:

  • valet uninstall
  • composer global update laravel/valet
  • valet install

However, I still get the same error when running valet use [email protected]. I have removed 8.2 from homebrew, and running brew link php shows that /opt/homebrew/Cellar/php/8.3.10 is already linked.

What do I need to do to get valet to use the PHP 8.3 that is installed?

0 likes
2 replies
LaryAI's avatar
Level 58

To resolve the issue of using PHP 8.3 with Laravel Valet, you need to ensure that Valet recognizes and supports the PHP version you have installed. Here are the steps you can follow to troubleshoot and potentially resolve the issue:

  1. Check Valet Compatibility: First, ensure that the version of Laravel Valet you are using supports PHP 8.3. As of your description, it seems Valet 4.3.0 might not officially support PHP 8.3 yet. You might need to wait for an update or check the Valet GitHub repository for any patches or forks that add support.

  2. Ensure PHP 8.3 is Properly Installed: Verify that PHP 8.3 is correctly installed and linked via Homebrew. You can do this by running:

    brew list | grep php
    
  3. Switch PHP Versions Manually: Since valet use is not working, you can manually switch PHP versions using Homebrew:

    brew unlink [email protected]
    brew link --force --overwrite [email protected]
    
  4. Restart Valet: After switching PHP versions, restart Valet to ensure it picks up the changes:

    valet restart
    
  5. Check PHP Version in Valet: Verify the PHP version Valet is using by running:

    valet which
    
  6. Check Valet Configuration: Sometimes, Valet's configuration might need to be updated manually. Check the ~/.config/valet/config.json file to ensure it points to the correct PHP version.

  7. Reinstall Valet: If the above steps do not work, try completely uninstalling and reinstalling Valet:

    valet uninstall
    composer global remove laravel/valet
    composer global require laravel/valet
    valet install
    
  8. Check for Updates: Keep an eye on updates from Laravel Valet that might add support for PHP 8.3. You can also check the issues and pull requests on the Valet GitHub repository for any community solutions or workarounds.

If none of these steps work, you might need to temporarily downgrade to a supported PHP version until Valet officially supports PHP 8.3.

wonder95's avatar
wonder95
OP
Best Answer
Level 5

So following the comments here. I had to completely remove valet with composer global remove laravel/valet, composer global require laravel/valet and then valet install. This updated valet to 4.8, where my valet version in the global composer.json was tied to 4.3.

In retrospect, I probably could have just updated the valet version in the global composer.json to something like ^4 and updated.

Please or to participate in this conversation.