Home > Software design >  Your Composer dependencies require a PHP version ">= 8.0.0"
Your Composer dependencies require a PHP version ">= 8.0.0"

Time:11-13

Hi I am trying to upload my Laravel 8 website to a host but I get the following error

enter image description here

In my composer.json file, I have it

enter image description here

I already updated my version of PHP in the hosting but I still have the same error, do you know what I can do ???

enter image description here

CodePudding user response:

If your webserver does not allow you to use PHP 8, please do not include that version in your own composer.json as an allowed version. If you do so, Composer might install packages that can not be used on your server, and this leads to the given error message.

Steps to resolve the problem:

  • set the version constraint in your composer.json to ^7.3 (removing |^8.0)
  • run composer update to recalculate the dependency tree
  • deploy your application

CodePudding user response:

You need to upgrade the PHP version to 8.0 on Hosting. But, I think above mentioned image shows, your hosting has only a 7.4 version (maximum).

So, If you have a maximum PHP 7.4 version then, downgrade your Laravel framework version to 7.x.

Laravel 7 is supported PHP >= 7.2.5

  • Related