EmmCall
EmmCall

Reputation: 182

Symfony 4 - php bin/console server:run not works

I have a problem with this command : php bin/console server:run on Symfony 4

When I go to http://127.0.0.1:8000/ I have this error message :

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 Fatal error: Unknown: Failed opening required 'J:\my_project\vendor\symfony\web-server-bundle/Resources/router.php' (include_path='.;C:\php\pear') in Unknown on line 0

Indeed, the router.php file does not exist !

But if I run this command : php -S 127.0.0.1:8000 -t public everything is ok.

Any idea ?

Upvotes: 0

Views: 17001

Answers (2)

Tobias Xy
Tobias Xy

Reputation: 2069

Not sure if this is the case for you too, but it is probably worth checking (and may also be interesting for others having the same problem).

My antivirus software likes to put the router.php in quarantine (effectively removing it from that directory). Check if yours did the same and if so restore it and create an exception for that file. Additionally you should configure your antivirus to notify you if it puts something in quarantine, so you can intervene in time.

Upvotes: 2

kasor
kasor

Reputation: 188

First check that you have installed the SF4 Web Server bundle :

> composer require server --dev

then you can start using it through Symfony using run / start command

Upvotes: 4

Related Questions