Symfony 3.3 built-in server error Symfony 3.3 built-in server error symfony symfony

Symfony 3.3 built-in server error


I had same problem,

Solved by :

  • Delete symfony folder in vendor

  • composer update

  • If you have antivirus (like Avast) disable it before launching webserver

  • php bin/console server:run


I got the same error, even when installing via composer.

It turns out that for whatever reason when composer downloaded the project, the required file listed in the error you get (vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle/Resources/router.php) was not included...

To fix this, I manually added it from https://github.com/symfony/web-server-bundle/blob/master/Resources/router.php and then my symfony app worked as expected.

I had to restart my computer in order to actually add the file because somehow I was locked out of adding it even as admin in Windows after launching the php server.

UPDATE:

Even better than manually adding the file, I just deleted the symfony folder from the vendor folder in the project and reran composer update. the router.php file is indeed downloaded. Sometimes when running bin/console server:run it gets deleted. Not sure why.


It happened to me when upgrading from Symfony 3.1 to Symfony 3.4.

The reason was that I had left the development server running when I executed the command:

composer update

The solution:

  • Delete the contents of vendor folder
  • Execute composer update
  • Install the new Symfony development server bundle (follow the instructions)
  • Execute the server for development in a new port

    php bin/console server:start localhost:3421