New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WebServerBundle] server not work after update #25515
Comments
Same here. I upgraded from 3.4.1. |
Same here, fresh new installs |
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 |
Here is all you need to do on your local development computer to reproduce the bug: symfony new testapp 3.4.2 In your web browser address bar, type http://127.0.0.1:8000 and press Enter. |
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 ? |
@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. |
Here is what I do and what I get:symfony new testapp 3.4.2
Local1:data abzolv$ cd testapp [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
|
@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. |
So, I debugged the behaviour and it seems to affect only php 7.0 (with php >= php 7.0). @fabpot @nicolas-grekas Do you have an idea on how to fix this since it seems that is a bug with php 7.0 only. |
Could using |
I'am developing with php 5.6.31 and I have the same problem |
php symfony new project 3.4
Preparing project... OK Symfony 3.4.2 was successfully installed. Now you can: php bin/console server:run Warning: require(index.php): failed to open stream: No such file or directory in C:\symfony4\project\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle\Resources\router.php on line 42 Fatal error: require(): Failed opening required 'index.php' (include_path='C:\xampp\php\PEAR') in C:\symfony4\project\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle\Resources\router.php on line 42 |
Thanks for the report, I think this is the same bug @pacogomezarnal. |
Thanks |
@chalasr I'm trying a fix with |
Thanks @chalasr it's working ! |
@Simperfit, just to potentially safe you a lot of headscrathing... according to http://php.net/manual/en/function.putenv.php#98540 putenv/getenv and $_ENV are two completely distinct environment stores. |
@abzolv Thanks but I did know that ^^ |
Looking for inside code, the bug is in If you do a var_dum($script), the result is index.php and is incorrect, because the correct file is app_dev.php |
But if you print APP_FRONT_CONTROLLER from WebServerConfig, the enviroment variable is correct because it prints app_dev.php |
Yes please check #25523. It fixes the bug |
OK. Thank you |
Checked and working |
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. |
@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.) |
…e the good file because of env (Simperfit) This PR was merged into the 3.3 branch. Discussion ---------- [WebServerBundle] fix a bug where require would not require the good file because of env | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #25515 | License | MIT | Doc PR | This fixes a bug with putenv that could be not working on certain version of php. (>=7.0.0). Commits ------- bfeee1f [WebServerBundle] fix a bug where require would not require the good file because of env
I have still the same issue. php: 7.0.0 / 7.2.0 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 |
The PR solving this was not part of a release yet. You would need up to depend on |
With Symfony 3.4, you can also run |
When I generated a new Bundle I faced this problem : How can I resolve it for symfony 3.4 Warning: require(index.php): failed to open stream: No such file or directory in C:\wamp64\www\symfony_project\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle\Resources\router.php on line 42 Fatal error: require(): Failed opening required 'index.php' (include_path='.;C:\php\pear') in C:\wamp64\www\symfony_project\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle\Resources\router.php on line 42 |
@cyx-veera like @damienalexandre said, or wait for a new release containing the patch. |
This work for me
sorry if I was wrong :) |
This work for me
Line 33 : |
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
The text was updated successfully, but these errors were encountered: