Is it Possible to Make Composer 2 work with PHP 7.4.33

165 Views Asked by At

I'm trying to get my PHP website app setup to use Cloudinary for image file storage.

On my local machine, I am running PHP Version 8.1.2. My website is on a shared-hosting site and is using PHP Version: 7.4.33. I've installed composer version 2.6.6.

On the hosting server, I cannot update the PHP version higher than 7.4.33 atm.

When I try to upload a file to cloudinary I get an error:

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

The error is pointing to: /vendor/composer/platform_check.php on line 24, but is triggered by line 7, I believe:

7 if (!(PHP_VERSION_ID >= 80100)) {
8    $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
9 }

I tried fudging the PHP_VERSION_ID to 70400, but that just lead to more errors in another file.

I tried downgrading my version of composer, but that did not help. Maybe the setup for composer 1 is different.

Is there a way to make composer work with PHP 7.4?

1

There are 1 best solutions below

0
John Cowan On

I was able to get the hosting service to update php to 8.1.2. it works now.