Where is composer.json?

Your software
My Mautic version is: 4.0.0
My PHP version is: 7.4.23
My Database type and version is: 10.3.31-MariaDB-0ubuntu0.20.04.1 - Ubuntu 20.04

These errors are showing in the log:
PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 7.4.0”. You are running 7.3.30. in /var/www/vhosts/xxxxxxxxx.com/mautic.xxxxxxxxx.com/vendor/composer/platform_check.php on line 24

Steps I have tried to fix the problem
I can’t find composer.json anywhere in my mautic installation to even try to solve this error.

Where is composer.json? Why does Composer think I am running 7.3.3?

I do see /vendor/composer/installed.json but I don’t know how anything in that file can confuse Composer program.

I am on AWS-Lightsail-Ubuntu-Plesk if that helps.

Hi, if you downloaded Mautic form release package there is a good chance you did not download “source code” version of release and these just have vendor folder with dependencies. Head over to mautic github repo. and download composer.json & composer.lock file, then try to follow steps bellow and see if that solves the issue.

Steps:

  • Backup current vendor directory (move it out of mautic dir)
  • Place composer files inside mautic directory.
  • In terminal type: composer config platform-check false
  • Then try to install dep. again with something like composer install --no-dev

More details on this composer error: Composer 2: Platform Check • PHP.Watch

Please note that this is more like workaround, I suspect server miss configuration and at the end gives you the above error.

Hope this helps.

Are you sure you are not running 7.3? It really looks so.

No, I am certain I have 7.4, Mautic says so. Though I understand that Composer can run on the system’s version of PHP and Plesk can run on something else, that is beyond me.

Thanks for your help.

Composer is difficult to work with under Plesk. I didn’t find docs that could help and what I did do made thinks worse (or at least different). I’ve saved my data and files and started from scratch, going straight to Mautic 4.0.

For anyone else with this problem using Plesk, this helped.