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
3
Answers
Try to update your php version in your composer.json file.
and then run composer update.
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"
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.