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

irfanadi's avatar

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

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

but the php version i run is php 8.12 how to fix this pls

0 likes
9 replies
tykus's avatar

Check the PHP CLI version in the terminal; it may not be the same version as PHP-FPM.

php -v
Sinnbeck's avatar

What php version does it give on the first line of the info?

composer about -vvv
irfanadi's avatar

@Sinnbeck im sorry but when i check the php version when i used php -v are php 8.1.2 and after i input composer about -vvv the output are : Running 2.5.1 (2022-12-22 15:33:54) with PHP 8.1.2-1ubuntu2.9 on Linux / 5.15.0-52-generic Failed to initialize global composer: Composer could not find the config file: /home/ofin_squad/.config/composer/composer.json

Sinnbeck's avatar

@irfanadi Well at least it shows the correct php version. And composer install give you (?

irfanadi's avatar

@Sinnbeck when i do that this happen :

Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run composer update or composer update <package name>. Nothing to install, update or remove Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead. Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Discovered Package: facade/ignition Discovered Package: fruitcake/laravel-cors Discovered Package: itsgoingd/clockwork Discovered Package: laravel/sail Discovered Package: laravel/sanctum Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. 77 packages you are using are looking for funding. Use the composer fund command to find out more!

Please or to participate in this conversation.