Trellis and Acorn problem?

Hey,
It’s my first real attempt to switch to roots stack and things get kinda funky:
Trellis, Bedrock are working after battle with nfs permissions … but when I want to add Sage to the combo and install Acorn i get this:

Fatal error : Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.2.0”. You are running 8.1.26. in /srv/www/proreture-crm.pl/current/web/app/themes/proreture/vendor/composer/platform_check.php on line 24

Okey, cool so I install php 8.2 on Vagrant:
php -v output:
PHP 8.2.13 (cli) (built: Nov 24 2023 08:47:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.13, Copyright (c) Zend Technologies
with Zend OPcache v8.2.13, Copyright (c), by Zend Technologies

At this point I am more then confused. Any idea?

Are you installing Acorn 3.x?

Otherwise, will need more info to help like your composer.json if you have added any other dependencies, etc.

Yes Acorn 3.3 via cli and no other dependencies. Just installed trellis + bedrock and then sage + acorn in theme directory ( also same happened when installed acorn in bedrock directory )

  1. This composer version error occurs during deployment, on the Vagrant development system?
  2. Your PHP update to version 8.2 does not fix the composer error?
  1. I have managed to run default theme, then install sage but when I install Acorn error occurs
  2. As I have mentioned it is output of php -v after i ssh to Vagrant and still error occurs

So you are using composer CLI from your workstation against the files that are mounted from within the Vagrant VM? Then your own workstation PHP version is also relevant (see update-alternatives).

1 Like

well I have also checked my own php version and it is 8.3. At the moment I have switched to DDEV local and works properly so far so good

You can force composer to run with a specific PHP version:
https://www.cyberciti.biz/faq/how-to-tell-and-force-composer-to-use-a-specific-php-version-such-as-7-x-or-8-x/
Does it work when you force it?

This error happens when you are running composer commands from different environments that have different PHP versions

For Trellis users, it’s recommended to run all composer commands from the VM to avoid this issue

You cannot install Sage or Acorn from your host machine that is using a PHP version that doesn’t match your Trellis PHP version

3 Likes

okey, that makes sense. Thanks but would stick to ddev for now i think.

1 Like

DDEV is a good option! I’m glad you’re up and running