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

FounderStartup's avatar

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.23.

Getting this error : Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.23. php -v shows PHP 8.1.10.

I have already updated to php 8.1

[brokergenies@server public_html]$ php -v PHP 8.1.10 (cli) (built: Sep 6 2022 18:12:49) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.10, Copyright (c) Zend Technologies with Zend OPcache v8.1.10, Copyright (c), by Zend Technologies

Any solution ?

0 likes
16 replies
Sinnbeck's avatar

Is this on shared hosting? Be aware that php might only be updated for the specific folder you are in

Can you run php8.1 -v

1 like
FounderStartup's avatar

@Sinnbeck Its a VPS on digital ocean.

The result of php8.1 -v is jailshell: php8.1: command not found

when I run php -v

[brokersadda@server dev]$ php -v PHP 8.1.10 (cli) (built: Sep 29 2022 01:02:57) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.10, Copyright (c) Zend Technologies with Zend OPcache v8.1.10, Copyright (c), by Zend Technologies [brokersadda@server dev]$

FounderStartup's avatar

@Sinnbeck This is what I am getting :

[brokersadda@server dev]$ sudo update-alternatives --config php sudo: effective uid is not 0, is /bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

Sinnbeck's avatar

@FounderStartup uhh you are getting that on the digital ocean linux server? What os is that? I have never heard of that error before

Sinnbeck's avatar

@FounderStartup ah ok. Im a Debian family guy (Ubuntu, Linux mint etc). Never tried centos. Try finding some guides on how to set the default php version on centos

1 like
FounderStartup's avatar

@Sinnbeck IN my another thread few days back you asked as follows :

What does which composer and which php give you It seems you changed php version for the directory only and composer is using the root php version

My answer is :

[brokersadda@server dev]$ which php /usr/local/bin/php [brokersadda@server dev]$ which composer /opt/cpanel/composer/bin/composer [brokersadda@server dev]$

Can it help to resolve this ?

Sinnbeck's avatar

@FounderStartup ah you are using cpanel. That's probably the problem. You only changed php version for your project and not for the server. See if you can change it globally

1 like
FounderStartup's avatar

@Sinnbeck I have a 5 account subscription of cpanel. And I am using two versions on all the five accounts. I this the issue ? Do I need to use only all versions on all the accounts ?

Sinnbeck's avatar

@FounderStartup I have never used cpanel before so I can't really advice. I normally just install Ubuntu and run 1 site per server.

We can see if we can trick the server instead

Does this give 8.1?

/usr/local/bin/php -v
1 like
FounderStartup's avatar

@Sinnbeck

[brokersadda@server dev]$ /usr/local/bin/php -v PHP 8.1.10 (cli) (built: Sep 29 2022 01:02:57) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.10, Copyright (c) Zend Technologies with Zend OPcache v8.1.10, Copyright (c), by Zend Technologies [brokersadda@server dev]$

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@FounderStartup does this work then?

/usr/local/bin/php /opt/cpanel/composer/bin/composer install 
1 like
FounderStartup's avatar

@Sinnbeck I actually updated composer which asked for a php extension :). After php extension I updated composer and it worked.

Thanks for your precious time Chief :)

Please or to participate in this conversation.