close

[Solved] Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.11

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.11 in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.11 Error Occurs?

Today I get the following error Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.11 in php.

How To Solve Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.11 Error ?

  1. How To Solve Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.11 Error ?

    To Solve Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.11 Error Simply change this version to match the one needed by composer (7.3 here)

  2. Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.11

    To Solve Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.11 Error Simply change this version to match the one needed by composer (7.3 here)

Solution 1

Kinda late to the party but in my case (Apache server on Ubuntu 18.04), apart from uninstalling previous versions of PHP and installing PHP v.7.4, I had to delete php7.2.conf and php7.2.load from /etc/apache2/mods-available/ for my Symfony project to register that I am indeed on version 7.4. Apparently these files persisted after I purged all previous PHP versions from my system and installed PHP v.7.4.

Solution 2

Maybe it can help someone like me, the problem was in symfony.lock

"php": {
    "version": "7.4"
},

Simply change this version to match the one needed by composer (7.3 here)

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment