0

I try to start a new simple symfony 5 project. When I start the server "symfony server : start", I have this answer :

Parse error: syntax error, unexpected '?' in C:Users\fadin\Desktop\cours\l3-web-2022-23-b-TP2\vendor\autoload_runtime.php on line 15. I have Windows 10, PHP 8.1.17, and Symfony 5.4.18.

It doesn't seem to understand the "?" symbol because it simply doesn't interpret it, I don't have an error in my code I can certify it

I try to launch a server that is local, and here is what my terminal displays:

enter image description here

I tried to reinstall PHP and symfony and Composer, I checked the PATH updates but I don't see what the problem is. I had seen that it was maybe a compatibility problem but I don't see how because I only have recent versions.

Elblocktri
  • 13
  • 4
  • is your composer configuration in sync with your target php version? https://stackoverflow.com/a/54736948/61795 – Scuzzy Mar 25 '23 at 02:49
  • 2
    You may have PHP/8.1.17 installed somewhere, but your web server is using PHP/5.5.38. That's a very ancient version and Symfony does not support it any more. – Álvaro González Mar 25 '23 at 08:45
  • What have you tried to resolve the problem? Where are you stuck? How is this problem related to Composer? – Nico Haase Mar 25 '23 at 08:55
  • @ÁlvaroGonzález Is there a difference between PHP CLI and CGI ? because even if the server is displayed in 5.5.38 in CGI, my php is in cli 8.1.17 with my symfony in 5.4.18 (which are recent versions) – Elblocktri Mar 25 '23 at 13:33
  • They're different binaries (php.exe vs php-cgi.exe) but that isn't the problem. You can drop a dozen different PHP versions in a different dozen folders. If you aren't really intending to have both versions, find where 5.4 is and remove it. – Álvaro González Mar 25 '23 at 17:52

0 Answers0