-2

I just wanted to try out Symfony 5 for my own education, so I followed the instructions here.

symfony check:requirements shows that I have the requirements needed to run the application (I'm running Windows 10 with php 7.3.4 running via php-cgi.exe)

I created the project by running symfony new my_project_name then, as per the instructions, cd into the project directory and run symfony server:start

The command line output says

[OK] Web server listening
The Web server is using PHP CGI 7.3.4
https://127.0.0.1:8000

But when I open the local IP address at port 8000 in my browser, I see an HTTP request as raw text, not the expected welcome page or even a 404 page.

enter image description here

Can anyone advise as to why the standard Symfony 5 startup instructions would not be producing the expected output and whether there's something more I need to configure to get the expected output?

Ambulare
  • 897
  • 3
  • 10
  • 32

2 Answers2

2

I had the same problem as you, but after running those commands the problem was solved:

$ symfony composer req profiler --dev
$ symfony composer req logger

and $ symfony composer req debug --dev

I think it's just a composer issue.

marwa
  • 21
  • 2
  • Thanks for this. Just 'symfony composer req debug --dev' worked for me. I think the problem is that in DEV mode, Symfony assumes that the debug toolbar is present. Installing it fixes the problem. – Jamie McLaughlin Jan 28 '22 at 12:34
1

You should create the application like this: symfony new my_project_name --full

Like the documentation page you linked says, symfony new my_project_name is for microservices, console applications and APIs. It does not have the packages required to be interpreted from plain text to a web page.

PXJesse
  • 38
  • 6
  • Awww, dammit, if I just misread the instructions I'm gonna kick myself. I spent ages trying to work out what was happening. – Ambulare Jun 02 '20 at 10:34
  • As per @marwa's answer below, you can get the skeleton version of Symfony to serve HTML as normal simply by installing the debug bundle as follows: symfony composer req debug --dev . I think the problem is that in DEV mode, Symfony assumes that the debug toolbar is present. – Jamie McLaughlin Jan 28 '22 at 12:33