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

后端 未结 14 2203
遇见更好的自我
遇见更好的自我 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:26

    I had this problem in the Azure WebApp I solved by setting the CGI to the correct version

       <handlers>
            <remove name="PHP74_via_FastCGI"/>
            <add name="PHP74_via_FastCGI" path="*.php" verb="GET, PUT, POST, DELETE, HEAD, OPTIONS" modules="FastCgiModule"
                 scriptProcessor="D:\Program Files\PHP\v7.4\php-cgi.exe" resourceType="Either" requireAccess="Script"/>
        </handlers>
    
    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题