0

After uploading my Laravel version 8.5 files. I keep getting this display instead of the landing page:

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2".

I've run the following commands:

a2dismod php7.4
a2enmod php8.1
service apache2 restart
update-alternatives --set php /usr/bin/php8.1
update-alternatives --set phar /usr/bin/phar8.1
update-alternatives --set phar.phar /usr/bin/phar.phar8.1

I've also restarted Apache with: /etc/init.d/apache2 restart

But I keep getting the same display, even after clearing my browser cache.

I'm sure Apache is still referencing the former PHP version according to: phpinfo()

Full Disclosure: I'm not proficient with Linux. My OS is Ubuntu 20.04, while my old PHP version is 7.4.29 and new PHP version is 8.1

miken32
  • 42,008
  • 16
  • 111
  • 154
Wasiu Adisa
  • 19
  • 1
  • 1
  • 4
  • 1
    Does this answer your question? [Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0"](https://stackoverflow.com/questions/65339404/composer-detected-issues-in-your-platform-your-composer-dependencies-require-a) – miken32 Jul 19 '23 at 22:42

3 Answers3

0

Had the same issue. Found that there were multiple versions of php installed and Apache was referencing one of the former PHP versions. Disabled each former version using a2dismod until the right version was being referenced. Hope this helps.

Tinashe
  • 9
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 09 '23 at 12:59
-1

You can specify the following dependencies in your composer.json file: To Downgrade :-

{
    "require": {
        "php": "^7.4.8",
        "laravel/framework": "^8.0",
        "laravel/tinker": "^2.0"
    }
}

To Upgrade:-

{
    "require": {
        "php": "^8.0.2",
        "laravel/framework": "^8.0", //insert your current laravel version here
        "laravel/tinker": "^2.0"
    }
}

Then run composer install, composer update to install/update the dependencies.

I had the same issue and solved it by this solution and after that even the php version checker began to check for 7.4.8 instead of the 8.0.2

-3

I don't think it's your PHP that's the problem. I think it is your Composer configuration. Composer is the link between your PHP and your apps. See How to solve Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2"