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

maparfitt's avatar

Valet installation fails with php 8

I'm unable to install valet on my machine (or actually re-install, as it was running fine a couple of days ago). Mac OS Big Sur, PHP 8.0.0_1. When I run "composer install", everything seems okay: "nothing to install, update, or remove." But when I run "composer global require laravel/valet", the installation fails. I'm getting three paragraphs of problems:

Problem 1 - fxp/composer-asset-plugin is locked to version v1.4.4 and an update of this package was not requested. - fxp/composer-asset-plugin v1.4.4 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint. Problem 2 - laravel/installer is locked to version v3.0.1 and an update of this package was not requested. - laravel/installer v3.0.1 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement. Problem 3 - laravel/installer v3.0.1 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement. - tightenco/lambo v0.5.5 requires laravel/installer >=3.0.1 -> satisfiable by laravel/installer[v3.0.1]. - tightenco/lambo is locked to version v0.5.5 and an update of this package was not requested.

I've followed the steps in the Laravel docs in "Valet#Resetting Your Installation." Same result.

I've also checked composer.json and composer.lock files to see if there's an issue, but I can't see anything obvious. What am I doing wrong? (Thanks!)

0 likes
9 replies
drehimself's avatar

Take a look at your global composer.json file in /Users/yourusername/.composer. It looks like some of these dependencies are out of date. Try updating the version of these dependencies then do a composer update and see if that helps. For example, the Laravel Installer should be at version ^4.1.

maparfitt's avatar

Thanks for your reply! I don't have a composer.json file in that location, but I do have one in my "code" folder. But it requires Laravel installer 4.1.

I tried uninstalling and reinstalling everything -- PHP, MySql, dnsmasq, and nginx -- then ran composer update. But I keep getting the same result with the same three sets of problems. When I run "laravel -v", it returns "Laravel Installer 3.0.1". I'm not sure why composer won't pull in v. 4.1.

drehimself's avatar

Hmm, weird that you don't have a composer.json file in there.

Try doing a which laravel and that should reveal where your global composer install is. For example, mine is /Users/dre/.composer/vendor/bin/laravel. Hopefully you can find the global composer.json file so you can update all the dependencies.

maparfitt's avatar

Thanks. When I run which laravel, I get /Users/m/.composer/vendor/bin/laravel. So there should be a composer.json file at that level, right? But there isn't one. Do I need to reinstall composer at the top level?

drehimself's avatar

Yeah, I would give that a try. You might lose your global composer dependencies but reinstalling them should be pretty straight forward.

maparfitt's avatar

I'm really stumped now. I placed a composer.json file and ran composer install at the user level. Composer installed laravel/installer (v4.1.1). Then I ran composer global require laravel/valet and I got the same result as before, with the three sets of problems, including laravel/installer v3.0.1 requires php ^7.2 .... So installation failed again.

drehimself's avatar
Level 35

At this point, I would just try to do a full re-install of composer.

Backup the files if you want to be safe.

Run which composer then delete that. Also delete the /Users/m/.composer folder. Then do a fresh install as described on the composer website.

At this point you'd have to reinstall all your global composer dependencies like the laravel installer and valet. Make sure you have a global composer.json file as described above. Hopefully that will sort everything out.

For reference, here's what my /Users/dre/.composer/composer.json file looks like. I have a new computer which I just setup last week.

{
    "require": {
        "laravel/valet": "^2.13",
        "laravel/installer": "^4.1",
        "beyondcode/expose": "^1.4"
    }
}

On second thought, you might have something weird going on in your .bashrc or .zshrc file. Check out those files too and investigate. Should be in the /Users/m/ folder.

1 like
maparfitt's avatar

Okay, I'll give that a try. It'll take a little while -- but I want to express my gratitude for your help right away. And hopefully this will work! Thank you!

maparfitt's avatar

Success!! I don't know exactly what was wrong, but uninstalling and reinstalling composer at the user level seems to have solved the problem, and valet is working. So I guess nothing weird going on with .bashrc or .zshrc, fortunately. Thanks again, very much, for your help!

1 like

Please or to participate in this conversation.