Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vicmazing's avatar

Composer dependencies require a PHP version ">= 8.0.2".

Hello Guys, I just deployed a fresh laravel project(v 8.77.1) to my production server and i keep getting this error "Composer dependencies require a PHP version ">= 8.0.2"." I tried using this solution composer install --ignore-platform-reqs but it just throws a Http 500 error, i've been tearing my hair out ever since because i don't know what to do. My Production server uses Ubuntu 20.04 and my php version is 8.0.14

0 likes
11 replies
Sinnbeck's avatar

Check that it actually has 8 on the cli as well. Run php -v

Sinnbeck's avatar

@vicmazing then run this in the same terminal. It will tell you the php version composer finds

composer -vvv about
2 likes
vicmazing's avatar

@Sinnbeck I just fixed it right now. I discovered that although i installed a more recent version, phpinfo() still showed the older version, so i had to disable it and enable the new one with ubuntu commands and it works pretty fine now, Thanks

drewdan's avatar

Hate to bump and old post, but:

If anyone gets here from Google like I did, and you use Laravel Forge. Don't forget that, in addition to installing the new PHP version on your server, you also need to go into the site itself, and tell it to use the new version. It can be found in the site under the meta menu.

rose_freeman's avatar

@drewdan

I installed a script on my subdomain and I keep getting this error after installation:: {Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2".} how can i fix this please

guillaumepommier's avatar

I'm using Valet on Ubuntu with PHP 8.0.14 and Laravel 8.83 and I had excatly the same issue. The problem occured because I was switching regularly between PHP 7 and PHP 8. In my case I had to verify if PHP 8 FPM was correctly running and it wasn't.

sudo systemctl status php8.0-fpm
php8.0-fpm.service: Main process exited, code=exited, status=78/CONFIG
php8.0-fpm.service: Failed with result 'exit-code'.
Failed to start The PHP 8.0 FastCGI Process Manager.

Then I removed valet.sock (which was in fact referencing PHP 7)

rm /home/guillaume/.valet/valet.sock

finally this did the trick

valet start
1 like
stur@iesebre.com's avatar

Try using

sudo update-alternatives --config php

And restart valet with valet restart

sergitet94's avatar

I faced the same problem, what I did was change the PHP version on my deployment server. it did the trick

1 like

Please or to participate in this conversation.