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

后端 未结 14 2240
遇见更好的自我
遇见更好的自我 2020-12-18 20:31

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/
14条回答
  •  我在风中等你
    2020-12-18 21:29

    My problem was updating php version with sudo update-alternatives --config php didn't update php-cgi.

    Symfony CLI was still using the old version of php-cgi:

    symfony local:php:list
    ┌─────────┬───────────┬────────────┬─────────┬────────────────┬─────────┬─────────┐
    │ Version │ Directory │  PHP CLI   │ PHP FPM │    PHP CGI     │ Server  │ System? │
    ├─────────┼───────────┼────────────┼─────────┼────────────────┼─────────┼─────────┤
    │ 7.2.34  │ /usr      │ bin/php7.2 │         │                │ PHP CLI │         │
    │ 7.3.23  │ /usr      │ bin/php7.3 │         │ bin/php-cgi7.3 │ PHP CGI │         │
    │ 7.4.11  │ /usr      │ bin/php7.4 │         │ bin/php-cgi7.3 │ PHP CGI │ *       │
    └─────────┴───────────┴────────────┴─────────┴────────────────┴─────────┴─────────┘
    

    I solved it by updating php-cgi:

    sudo apt-get install -y php-cgi
    

提交回复
热议问题