How to solve Root composer.json requires PHP ^7.3 but your PHP version (8.0.0) does not satisfy that requirement
Today, we will learn How to solve Root composer.json requires PHP ^7.3 but your PHP version (8.0.0) does not satisfy that requirement in the Laravel application. Today I am running composer install in the project and getting this error Root composer.json requires PHP ^7.3 but your PHP version (8.0.0) does not satisfy that requirement. This error comes to the PHP version defined in your composer.json file. Simple update this requirement composer.json file to PHP: “^7.3|^8.0”. And the second solution is you are using composer install and you are facing this error. So you can run only the composer install command with ignoring platform requirements.
Also read: Laravel 8 Custom Forgot & Reset Password Example
The error looks like below:
Problem 1
- Root composer.json requires php ^7.1.3 but your php version (8.0.0) does not satisfy that requirement.
Problem 2
- laravel/framework[v5.8.0, ..., 5.8.x-dev] require php ^7.1.3 -> your php version (8.0.0) does not satisfy that requirement.
- Root composer.json requires laravel/framework 5.8.* -> satisfiable by laravel/framework[v5.8.0, ..., 5.8.x-dev].
So, I can explain to you how to solve the possible solutions here.
Update php requirement in composer.json
This error comes to the PHP version defined in your composer.json file.
#composer.json #Old Code ... "require": { "php": ">=7.3", ... }, ...
Just Update this requirement composer.json file to PHP: “^7.3|^8.0” something like this below.
Also read: Laravel 8 group by doesn’t work – fixed
#composer.json #New Code ... "require": { "php": "^7.3|^8.0", ... }, ...
Using the command
If you are running composer install and you get this error, then you run a simple composer install command with ignoring platform requirements. Please check the below command.
Also read: Laravel 8 authentication example
composer install --ignore-platform-reqs
Summary
If have any issues, please leave a comment with your thoughts and which example is helpful. if helpful this tutorial please add a comment in “+1” OR “Thank you“.
my problem is solved. thanks
You’re most welcome! I’m glad your problem is resolved. 😊 If you have more questions in the future, feel free to ask. Happy coding! 🚀
Thank you – this helped me fix my issue.
You’re very welcome! I’m glad I could help you resolve your issue. If you need assistance with anything else, just let me know. Happy coding! 😊
+1
Thank you! 😊 Happy to help anytime! 🚀