PHP Version error

Error Message

Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.1.0”.

How do you resolve this?

10 Likes

Thank you so much, I followed through

However, am encountering this error after setting the platform to PHP version 7.4:

Problem 1
- Root composer.json requires laravel/sanctum ^3.2 → satisfiable by laravel/sanctum[v3.2.0, …, 3.x-dev].
- laravel/sanctum[v3.2.0, …, 3.x-dev] require php ^8.0.2 → your php version (7.4; overridden via config.platform, actual: 8.2.0) does not satisfy that requirement.
Problem 2
- Root composer.json requires laravel/ui ^4.2 → satisfiable by laravel/ui[v4.2.0, v4.2.1, v4.2.2, 4.x-dev].
- laravel/ui[v4.2.0, …, 4.x-dev] require php ^8.0 → your php version (7.4; overridden via config.platform, actual: 8.2.0) does not satisfy that requirement.
Problem 3
- laravel/framework[v10.0.0, …, 10.x-dev] require php ^8.1 → your php version (7.4; overridden via config.platform, actual: 8.2.0) does not satisfy that requirement.
- Root composer.json requires laravel/framework ^10.0 → satisfiable by laravel/framework[v10.0.0, …, 10.x-dev].

You’ll also have to downgrade the dependencies to versions that still support PHP 7.4 on your composer.json file.

9 Likes

Any idea how? Been trying to get started but i can’t find such resources

The easiest way is to run composer update from PHP 7.4 if you have a computer that already has PHP 7.4 installed, as explained from the topic @anon50163844 linked to.

5 Likes

Am making some progress on that, I have been able to downgrade some dependencies. Let me see the final outcome.

Besides, after the composer is done updating, what am I again supposed to upload into the htdocs?

Read that topic again

8 Likes

That’s where am confused, '“upload the generated folder here”…does here mean the htdocs?

Yeah, you’ll have to upload the generated folder on your htdocs folder.

7 Likes

Alright, thanks a lot :innocent:

3 Likes

Check this for me please, it’s giving me headache and am getting tired

"require": {
        "php": ">=7.4",
        "guzzlehttp/guzzle": "^7.2",
        "illuminate/support": "^7.0",
        "laravel/sanctum": "^2.11.1",
        "laravel/tinker": "^2.8",
        "laravel/ui": "^2.4.1",
        "nadar/quill-delta-parser": "^3.3",
        "tcg/voyager": "dev-1.6-l10"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.18",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^5.0.0",
        "phpunit/phpunit": "^9.5.10",
        "spatie/laravel-ignition": "^2.1.1"
    },

when I run composer update, am getting these errors:

Problem 1

  • Root composer.json requires tcg/voyager dev-1.6-l10 → satisfiable by tcg/voyager[dev-1.6-l10].
  • tcg/voyager dev-1.6-l10 requires illuminate/support ~8.0|~9.0|~10.0 → found illuminate/support[v8.0.0, …, 8.x-dev, v9.0.0-beta.1, …, 9.x-dev, v10.0.0, …, 10.x-dev] but it conflicts with your root composer.json require (^7.0).

Problem 2

  • laravel/sail[v1.18.0, …, v1.21.5] require illuminate/support ^8.0|^9.0|^10.0 → found illuminate/support[v8.0.0, …, 8.x-dev, v9.0.0-beta.1, …, 9.x-dev, v10.0.0, …, 10.x-dev] but it conflicts with your root composer.json require (^7.0).
  • laravel/sail[v1.22.0, …, 1.x-dev] require php ^8.0 → your php version (7.4.8; overridden via config.platform, actual: 8.2.0) does not satisfy that requirement.
  • Root composer.json requires laravel/sail ^1.18 → satisfiable by laravel/sail[v1.18.0, …, 1.x-dev].

If there is someone that knows the compatible versions, please help. Am trying but mmmm

Generally, you can’t mix and match package versions. I’ve tried it in the past and had no luck, much like you. I don’t think there’s any easy way to solve this.

Your best bet is to choose an older version of the original package and let it install all of the correct versions around that.

7 Likes

Show me how please

It’s usually not that difficult to find the right versions if you know where to look and carefully read the error messages.

This error says that the version of tcg/voyager is incompatible with Laravel 7. So if you look up this package on Packagist, you can just go through the versions and find the latest one that supports Laravel 7. As far as I can tell, that would be version 1.5.*.

This one is a bit harder to solve. Looking again in Packagist, Laravel Sail requires at least Laravel version 8. There is no way around that.

However, looking at it again, it seems that Laravel 8 also works on PHP 7.4. So you could also upgrade Laravel instead of downgrading Sail.

As a bonus, if you do this, you don’t have to downgrade tcg/voyager at all, because the latest version supports Laravel 8.

9 Likes

Well, thank you so much for the help and everything guys…I managed to run the composer update, it worked but now my whole project seems to have errors…and that’s gonna be a hustle to fix

If there could be a way for the system to support latest php versions, well that would be great

2 Likes

We already started the upgrade to PHP 8.1 a few months ago but ran into some issues we needed to fix first. Rest assured it’s very high on the list of priorities!

6 Likes

here = here on hosting (upload from local to hosting)

htdocs is implied - because all files must go in that folder, you can’t even upload somewhere outside that folder (will be automatically deleted).

7 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.