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
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 )
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).
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.
It means exactly that. You run composer commands on your VM. Not your host machine.
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.
@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)?