How to Fix Composer Fatal Error Due to Incompatible PHP Version

How to Fix Composer Fatal Error Due to Incompatible PHP Version

Error:

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

You just need to run below command using your terminal ( cmd, powershell, linux, gitbash, etc) and waiting update :

composer update

Composer Update on Laravel Project: Is Your Data Safe?

When “composer update” is executed on a Laravel project, the relevant packages are updated, and the versions of those packages are adjusted based on the composer.json file. However, if a “PHP Fatal error” is encountered due to Composer dependencies requiring a higher PHP version, it is necessary to upgrade PHP before “composer update” can be run. This is because Composer requires a compatible PHP version with the requested dependencies to function properly. Thus, to ensure the safety of a Laravel project’s data, it is recommended that the data be backed up before upgrading PHP, and “composer update” is run only after ensuring that the PHP version is updated to the version required by Composer dependencies.

Leave a Comment