. Advertisement .
..3..
. Advertisement .
..4..
Laravel is a free, open-source PHP web framework created by Taylor Otwell and intended to develop web applications that follow the model view controller architecture and are based on Symfony.
When you try to complete your task, you get this error: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 7.3.0” in laravel.
This error is one of the most popular errors any programmer will make. So, why does it appear, and how can it be resolved? We’ll go over it with you.
What is “Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 7.3.0” in laravel ?
You are trying to update the composer with composer self-update –2, and you are getting the following error in your terminal.
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0".
Here is an example for composer.json :
"require": {
"php": "^7.3|^8.0",
}
"config": {
"platform": {
"php": "7.3.0"
}
"optimize-autoloader": true,
"preferred-install": "dist",
"platform-check": false
},
The Effective Methods For You To Fix Error
And, guess what, we just solved it using some methods listed below.
Method 1: Check the php version
First, you can examine the platform check file your-project-path/vendor/composer/platform check.php in your project.
Then you need to remove the extra code or comment it out. Add the platform check option to the composer.json configuration section below.
"config": { "platform-check": false },
You could now run.
composer update
When you run composer update, platform check.php will be deleted, and your problem will be resolved.
Method 2: Run command with –ignore-platform-reqs
The most straightforward solution is to ignore platform requirements. Execute this command.
composer install --ignore-platform-reqs
Or you can use this code.
composer update --ignore-platform-reqs
Now, we believe that your error has been tackled.
Method 3: Use this command line
Access the following path:~/.composer/vendor/composer/platform_check.php, Use below command line and re-run valet use php –force to fix error:
if (!(PHP_VERSION_ID >= 70300)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.';
}
Approach 4: Adjusting the php7.2
Another approach to fix the above error is that you can Adjusting the php7.2. Run the commands below:
sudo a2dismod php7.2
sudo a2enmod php7.4
sudo service apache2 restart
Conclusion
Laravel is a free and open-source PHP framework built to support the development of software and applications, following the MVC architecture.
The solutions mentioned above are the best options for those still confused with this error: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 7.3.0” in laravel.
If you still need support or have other questions, we have one vibrant community where all members are always willing to give you a hand. We wish you a more successful day with new solutions and new code.
Leave a comment