I want to create a Symfony CRUD application. These are the steps I did:
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>
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