Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

symfony

I want to create a Symfony CRUD application. These are the steps I did:

  • Downloaded and installed XAMPP from here with PHP 7.3.11 https://www.apachefriends.org/de/index.html
  • Navigated to htdocs with the CLI of Windows.
  • Created a symfony project with the command composer create-project symfony/skeleton my_project
  • Opened up my browser (Firefox 70.0.1) and navigate to the URL: localhost/my_project/public/

Here I got the error message:

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

When I check my php version in the CLI with php -v I get the result that I use PHP 7.4.0 (cli). When I check the php version by clicking the PHPInfo on the dashboard of XAMPP (localhost/dashboard/phpinfo.php), the page shows me the php version 7.3.11.

In the created symfony folder is a file called symfony.lock. There is an entry called "php": { "version": "7.4" },. Changing this entry did not solve my problem.

Any ideas how to solve this? And why I cannot install and test the newest symfony with XAMPP?

Thanks a lot guys!

Musa

like image 836
Musa Avatar asked Dec 02 '19 14:12

Musa


People also ask

What is composer lock PHP?

composer. lock records the exact versions that are installed. So that you are in the same versions with your co-workers. composer install. Check for composer.lock file.

How do I upgrade PHP?

Scroll down to the Advanced settings tile and select PHP and database settings. Scroll down to Update PHP version. Select the PHP version you want to switch to and click Update.

How do I check my PHP version?

Typing php -v now shows the PHP version installed on your Windows system.


1 Answers

You should run composer dump-autoload

like image 123
user1077915 Avatar answered Sep 28 '22 09:09

user1077915