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

vincej's avatar
Level 15

Composer detected issues in your platform:require a PHP version ">= 8.0.0".

I have just installed composer and Laravel 8 onto DigitalOcean Ubuntu 20 server and I am getting this error

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

The stupid thing I am running PHP 8.0.12

PHP 8.0.12 (cli) (built: Oct 22 2021 12:34:48) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.12, Copyright (c), by Zend Technologies

Furthermore, I ran a test looking at my platform dependancies and they have all come out clean:

Checking platform requirements for packages in the vendor dir
ext-curl       8.0.12      success  
ext-dom        20031129    success  
ext-fileinfo   8.0.12      success  
ext-filter     8.0.12      success  
ext-json       8.0.12      success  
ext-libxml     8.0.12      success  
ext-mbstring   8.0.12      success  
ext-openssl    8.0.12      success  
ext-pcre       8.0.12      success  
ext-phar       8.0.12      success  
ext-tokenizer  8.0.12      success  
ext-xml        8.0.12      success  
ext-xmlwriter  8.0.12      success  
lib-pcre       10.34       success  
php            8.0.12      success  

I have also rebooted my machine.

CodeGrepper tells me I should just ignore the platform requirements, but that does not feel right to me. I have never had this error before. composer install --ignore-platform-reqs

Any ideas what is going on and how to fix it?

Many thanks !

0 likes
16 replies
Sinnbeck's avatar

Try the following and post what it returns (it will tell you want version composer finds)

composer -vvv about 
vincej's avatar
Level 15

I thank you both for your responses. I am grateful. In the end, I gave up and just destroyed the server ( aka "droplet" in DigitalOcean speak) and reinstalled. So, problem solved the brute force way. Now I have everthing installed, I have a new problem to do with "rate limiter" not being found. But heah - it's Friday night, and tomorrow will bring a new day and a new post. Cheers! Vince.

vincej's avatar
Level 15

I'm back. I hope you can help some more with composer which still giving me problems even after a reinstall.

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

And as before I am running php 8.0.12 and as before I get a clean result on all my dependancies.

I tried the --ignore-platform-reqs: and all I got then is an http:500.

This is a clean install of L8. There are no personal files or dir on the system, and I am not getting the welcome page. For the moment, my permissions are wide open to 777.

ok - so I did what @sinnbeck suggested, and got a curious statement saying it could not find the config for composer. Weird as it functions.

root@contraxiq:/var/www/html# composer -vvv about
Running 2.1.9 (2021-10-05 09:47:38) with PHP 8.0.12 on Linux / 5.4.0-89-generic
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]?
Reading ./composer.json (/var/www/html/composer.json)
Loading config file ./composer.json (/var/www/html/composer.json)
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www/html): git branch -a --no-color --no-abbrev -v
Executing command (/var/www/html): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (/var/www/html): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (/var/www/html): hg branch
Executing command (/var/www/html): fossil branch list
Executing command (/var/www/html): fossil tag list
Executing command (/var/www/html): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /root/.config/composer/composer.json

Reading /var/www/html/vendor/composer/installed.json
Composer - Dependency Manager for PHP - version 2.1.9
Composer is a dependency manager tracking local dependencies of your projects and libraries.
See https://getcomposer.org/ for more information.

Many thanks !!

Snapey's avatar

checking for composer.json, how far do you get in checking the path to the config?

What user were you logged in as when you installed composer?

vincej's avatar
Level 15

@Snapey When I installed I install as root. i'll check how far I get as root.

vincej's avatar
Level 15

I can't believe what I have just seen. When I do a php -v I get:

root@contraxiq:/var/www/html# php -v
PHP 8.0.12 (cli) (built: Oct 22 2021 12:34:48) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.12, Copyright (c) Zend Technologies
 with Zend OPcache v8.0.12, Copyright (c), by Zend Technologies

But when I run phpinfo() I'm getting PHP 7.4.3!!!! What the heck?

1 like
Snapey's avatar

when you run phpinfo you are getting the web version not the cli version

Your website can run a different version to what is in your path.

Apache or nginx?

vincej's avatar
Level 15

@Snapey All fixed! I spent so much time fighting with Nginx that in the end I just ripped it out and put in Apache. At least I know what I am doing with that. Lesson learned. The real core mistake I made was in using a "one click" install for everything including laravel from "devdojo" ( doggieDojo?) who offers this on the DigitalOcean market place (free) Whilst it worked, I did not realise how out of date it was until it was installed. So another lesson learned: when it comes to the core plumbing, install every piece yourself. Many thanks ! Cheers !!

Sinnbeck's avatar

@vincej I can suggest using something like ploi to handle setting up the server. It just works

vincej's avatar
Level 15

@Sinnbeck Many thanks for that suggestion - I will bear it in mind next time. btw, I am guessing you must be in Europe, as no one other than me is stupid enough at this hour to be doing anything in North America. I am based in Calgary Canada. Cheers!

Sinnbeck's avatar

@vincej haha yeah Denmark here and the kids are up early. Ploi is free for 1 server, so you could give it a try to see how awesome it is

vincej's avatar
Level 15

@Sinnbeck Just had a look - it looks a little like cloudways. Great idea. Thanks.

Sinnbeck's avatar

@vincej it integrates with different server hosts like digital ocean and hetzner. So they create and manage the server for you. Same as forge

1 like

Please or to participate in this conversation.