Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | yes |
RFC? | no |
Symfony version | 3.4.2 |
After "composer update" to migrate from 3.3. to 3.4, the WebServerBundle no longer works.
When i open the site in bowser, i have this error:
PHP Warning: require(index.php): failed to open stream: No such file or directory in vendor/symfony/symfony/src/Symfony/Bundle/WebServerBundle/Resources/router.php on line 42
Activity
abzolv commentedon Dec 15, 2017
Same here. I upgraded from 3.4.1.
remindbg commentedon Dec 15, 2017
Same here, fresh new installs
Simperfit commentedon Dec 16, 2017
Could you please post a reproducer on github ? Because i've test both symfony-standard and flex (symfony-skeleton) on fresh install and they are both working.
In case you need some help you can read this blog post : https://symfony.com/doc/current/contributing/code/reproducer.html
abzolv commentedon Dec 16, 2017
Here is all you need to do on your local development computer to reproduce the bug:
symfony new testapp 3.4.2
cd testapp
composer require symfony/web-server-bundle
./bin/console server:run
In your web browser address bar, type http://127.0.0.1:8000 and press Enter.
Simperfit commentedon Dec 16, 2017
Same as flex :
By the way, if you use the symfony installer you don't need to require de web-server-bundle since it requires symfony/symfony (so the whole framework).
Event following what you said still cannot reproduce. I get an error, I can't run the server.
@Valix could you please send us the steps to get this error ? Are you using windows or linux ? Do you a have empty public folder ?
abzolv commentedon Dec 16, 2017
@Simperfit, why are you testing this under V4.0.2? The problem is in 3.4.2. The web server works perfectly in 3.4.1. It is broken in 3.4.2.
Simperfit commentedon Dec 16, 2017
I'm not testing this under 4.0.2, it's using the composer it install 4.0.2, not using composer you have already the webserver installed and it works.

abzolv commentedon Dec 16, 2017
Here is what I do and what I get:
symfony new testapp 3.4.2
Downloading Symfony...
[snip]
Preparing project...
✔ Symfony 3.4.2 was successfully installed. Now you can:
* Change your current directory to /data/testapp
* Configure your application in app/config/parameters.yml file.
Local1:data abzolv$ cd testapp
Local1:data abzolv$ ./bin/console server:run
[OK] Server listening on http://127.0.0.1:8000
// Quit the server with CONTROL-C.
PHP 7.0.16 Development Server started at Sat Dec 16 08:43:01 2017
Listening on http://127.0.0.1:8000
Document root is /data/testapp/web
Press Ctrl-C to quit.
In the web browser I get the error:
Fatal error: require(): Failed opening required 'index.php' (include_path='.:') in /data/testapp/vendor/symfony/symfony/src/Symfony/Bundle/WebServerBundle/Resources/router.php on line 42
Points to note:
Simperfit commentedon Dec 16, 2017
@abzolv Thanks! With the version of PHP I can reproduce the bug. Ill try to look into this to understand why with this version of php the behaviour is wrong.
12 remaining items
pacogomezarnal commentedon Dec 17, 2017
But if you print APP_FRONT_CONTROLLER from WebServerConfig, the enviroment variable is correct because it prints app_dev.php
Simperfit commentedon Dec 17, 2017
Yes please check #25523. It fixes the bug
pacogomezarnal commentedon Dec 17, 2017
OK. Thank you
pacogomezarnal commentedon Dec 17, 2017
Checked and working
abzolv commentedon Dec 19, 2017
I want to ask a question here that's been bugging me for a few days.
Does this issue perhaps reveal an important gap in Symfony's quality assurance processes?
Most people would not use the leading or bleeding edge versions of either Symfony or PHP to develop large production systems. Most people would use the latest LTS versions.
This bug was caused by a combination of PHP and Symfony versions that were not the latest and greatest versions in the development cycles of either. And Symfony's QA processes missed it, even though the bug rendered the WebserverBundle completely inoperative.
So, the question is, going forward, how can it be assured that combinations of older versions get properly QA'd to prevent similar bugs from slipping through in versions that are likely used by most people for serious production work?
I wouldn't want to venture any recommendations because I'm not familiar with Symfony's existing QA procedures.
nicolas-grekas commentedon Dec 19, 2017
@abzolv WebServerBundle is a pure dev dependency. The thing that is broken is a helper that never runs at prod time. It may happen that this is less tested than the more critical parts of the code (every other part of the code base is more critical for sure.)
bug #25523 [WebServerBundle] fix a bug where require would not requir…
johnrivelt commentedon Dec 27, 2017
I have still the same issue.
It seems that symfony lts still indicates old dependencies which has a bug.
php: 7.0.0 / 7.2.0
os : windows 10
php symfony new project lts => 3.4.2
php bin/console server:run
Warning: require(index.php): failed to open stream: No such file or directory in ~\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle\Resources\router.php on line 42
Fatal error: require(): Failed opening required 'index.php' (include_path='C:\wamp\php\PEAR') in ~\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle\Resources\router.php on line 42
xabbuh commentedon Dec 27, 2017
The PR solving this was not part of a release yet. You would need up to depend on
3.4@dev
for now.damienalexandre commentedon Dec 28, 2017
With Symfony 3.4, you can also run
APP_FRONT_CONTROLLER=app.php php bin/console server:start
instead of installing a not tagged version.Simperfit commentedon Jan 4, 2018
@cyx-veera like @damienalexandre said, or wait for a new release containing the patch.
godoakbrutal commentedon Feb 20, 2018
This work for me
cache
in var folder) and doclear:cache
server:stop
then make a newserver:start
sorry if I was wrong :)
oukhrib commentedon Feb 6, 2019
This work for me
$script = isset($_ENV['APP_FRONT_CONTROLLER']) ? $_ENV['APP_FRONT_CONTROLLER'] : 'app_dev.php';
Line 33 :
app_dev.php
instead ofindex.php