Sage Mac m1 php composer dependencies require 8.1 you are using 8.0

I can’t activate sage theme without this error and I don’t have a clue how to update this. Using Mac M1 with parallels vm

Are you using Acorn? If so, what version? And what’s in your theme’s composer.json?
Your local php version is 8.0?

I had exactly same problem. This is todo with your local php version being higher.
You simply need to use brew install php@8.0 then brew unlink php@8.1 after that brew link php@8.0

1 Like

Yeah or bump the php version constraint to 8.1 in the composer.json?

I was using the acorn version from the install docs on Sage with composer. As of now the only way for me to get this working is installing the plugin version from GitHub. How would I change the php version constraint to 8.1 in the composer.json?

Try changing this line:

to:

"^7.4|^8.1"

and run:

rm -rf vendor && rm composer.lock && composer install
2 Likes

Fatal error : Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.1.0”. You are running 8.0.19

this is the error that brought me here… to recap: trellis up from parallels arm64 box, downloaded sage to the themes folder cd to sage composer require acorn then Fatal error… Im starting from scratch for the 20th time at this point will report back… Thanks for the help!

My Solution: group_vars/all/main.yml >change php version from 8.0 to 8.1 …trellis up.
wp throws depreciate error until you activate the sage theme

1 Like

Any news on this? Still getting the error.

Im using
Mac M1
Current Acorn (v2.1) installed with Composer in Combination with the current bedrock build.
Running Local with PHP 8.0

Modifying the php Version in composer.json and reinstall the packages did not work.

Have you tried using the platform option in the config?

1 Like

I had the same issue and downgrading both my local php version and acorn (v3x to v2.1) solved the problem.

same issue for me on a Mac m1 on a brand new trellis/bedrock/sage10 project but with php 8.2 alert msg.

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0". You are running 8.1.27. in /srv/www/sage10.co.uk/current/web/app/themes/xxxx/vendor/composer/platform_check.php on line 24

@Twansparant I tried to bump the php version constraint to >=8.2 in the composer.json and delete vendor folder and composer.lock, and run again composer install and composer update, with no luck.

this solution worked, change the php version here group_vars/all/main.yml >change php version from 8.1 to 8.2, but I am wondering if it is a good thing to do or if it will cause more problems in the future. (for example I saw in another post that WP-CLI is incompatible with PHP 8.2 so I am not sure if changing this line in group_vars/all/main.yml is the right thing to do)

any ideas?

This means you already installed your Composer dependencies from PHP 8.2, and then tried to install them again from a PHP 8.1 env. Since you use Trellis, you should only be running Composer commands from the VM.

Do you want to use PHP 8.2? That’s up to you

Do you want to use PHP 8.1 instead? Then don’t install Composer deps from a machine that isn’t running PHP 8.1