# Trellis and Acorn problem?

**URL:** https://discourse.roots.io/t/trellis-and-acorn-problem/26441
**Category:** sage
**Tags:** trellis, sage10, acorn
**Created:** 2023-12-19T22:45:37Z
**Posts:** 16

## Post 1 by @devJamStudio — 2023-12-19T22:45:37Z

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?

---

## Post 2 by @Log1x — 2023-12-19T23:17:30Z

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.

---

## Post 3 by @devJamStudio — 2023-12-20T08:14:14Z

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 )

---

## Post 4 by @strarsis — 2023-12-20T09:49:50Z

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?

---

## Post 5 by @devJamStudio — 2023-12-20T11:14:38Z

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

---

## Post 6 by @strarsis — 2023-12-20T12:50:34Z

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).

---

## Post 7 by @devJamStudio — 2023-12-20T14:25:39Z

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

---

## Post 8 by @strarsis — 2023-12-20T15:33:16Z

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/](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?

---

## Post 9 by @ben — 2023-12-20T16:07:06Z

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

---

## Post 10 by @devJamStudio — 2023-12-21T15:34:22Z

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

---

## Post 11 by @ben — 2023-12-21T15:35:30Z

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

---

## Post 12 by @toddsantoro — 2024-03-26T18:53:17Z

What exactly is meant by " For Trellis users, it’s recommended to run all `composer` commands from the VM"?

`php -v`  
PHP 8.3.4 (cli) (built: Mar 12 2024 23:42:26) (NTS)  
Copyright (c) The PHP Group  
Zend Engine v4.3.4, Copyright (c) Zend Technologies  
with Zend OPcache v8.3.4, Copyright (c), by Zend Technologies

and I get this error  
`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/designerlaser.art/current/vendor/composer/platform_check.php on line 24`

I have never had this issue before.

I am running a standard Trellis w/ Bedrock and the sage 10 theme with acorn installed in the site directory locally. This is happening in local developemnt.

---

## Post 13 by @ben — 2024-03-26T19:09:02Z

> [@toddsantoro](#):
>
> What exactly is meant by " For Trellis users, it’s recommended to run all `composer` commands from the VM"?

It means exactly that. You run `composer` commands on your VM. Not your host machine.

> [@toddsantoro](#):
>
> I get this error  
> `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/designerlaser.art/current/vendor/composer/platform_check.php on line 24`

Again re-iterating what I said earlier in this topic:

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

When you start your local box with Trellis, it mentions the following:

```
==> default: Your Trellis Vagrant box is ready to use!
==> default: * Composer and WP-CLI commands need to be run on the virtual machine
==> default: for any post-provision modifications.
==> default: * You can SSH into the machine with `vagrant ssh`.
==> default: * Then navigate to your WordPress sites at `/srv/www`
==> default: or to your Trellis files at `/home/vagrant/trellis`.
```

Note:

> **Composer and WP-CLI commands need to be run on the virtual machine**

Per your post, your local machine is running PHP 8.3. Your local dev VM is running PHP 8.1.

---

## Post 14 by @toddsantoro — 2024-03-26T19:11:04Z

@ben how do I bump the VM to 8.3? And once my VM is started via `trellis vm start` would I be running commands on the VM when inside my theme folder and when I add acorn to my bedrock folder (site)?

---

## Post 15 by @ben — 2024-03-26T19:18:22Z

> how do I bump the VM to 8.3?

Can you create a new topic? This one is solved and upgrading the PHP version in Trellis is not related to this issue

I’d also urge you to search the forum and Trellis repo since there’s many existing examples/discussions about changing PHP versions

> would I be running commands on the VM when inside my theme folder and when I add acorn to my bedrock folder (site)

Is it a `composer` command? Then the answer is yes…

---

## Post 16 by @ben — 2024-03-26T19:18:25Z


