Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[WebServerBundle] Error when using custom router path/file #23206

Closed
@acrobat

Description

@acrobat
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.2

We are using the server:run command in our travis-ci test suite to run behat tests. We specify a custom router file for the behat tests environment.

In symfony 3.2.x it worked fine:

→ app/console server:run 127.0.0.1:8080 --env=test_travis --router=app/config/router_test_travis.php 

                                                                                                                        
 [OK] Server running on http://127.0.0.1:8080                                                                           
                                                                                                                        

 // Quit the server with CONTROL-C.                                                                                     

PHP 7.1.6-1~ubuntu16.04.1+deb.sury.org+1 Development Server started at Fri Jun 16 09:28:54 2017
Listening on http://127.0.0.1:8080
Document root is /path/to/web
Press Ctrl-C to quit.
[Fri Jun 16 09:28:58 2017] 127.0.0.1:36272 [200]: /
[Fri Jun 16 09:28:58 2017] 127.0.0.1:36274 [404]: /css/345a2cf.css
[Fri Jun 16 09:28:58 2017] 127.0.0.1:36276 [404]: /js/f0fb6d7.js
[Fri Jun 16 09:28:58 2017] 127.0.0.1:36310 [404]: /js/66e68a2.js
[Fri Jun 16 09:28:58 2017] 127.0.0.1:36312 [200]: /bundles/xxxxx/img/logo.png
[Fri Jun 16 09:28:58 2017] 127.0.0.1:36314 [200]: /bundles/xxxxx/img/chimney.png
[Fri Jun 16 09:28:58 2017] 127.0.0.1:36328 [404]: /js/f0fb6d7.js
[Fri Jun 16 09:28:58 2017] 127.0.0.1:36352 [404]: /js/66e68a2.js
[Fri Jun 16 09:28:58 2017] 127.0.0.1:36364 [200]: /bundles/xxxxx/img/ico/favicon.ico
Symfony packages
symfony/assetic-bundle                 v2.8.1  Integrates Assetic into Symfony2
symfony/monolog-bundle                 v2.12.1 Symfony MonologBundle
symfony/polyfill-intl-icu              v1.3.0  Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring              v1.3.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php54                 v1.3.0  Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions
symfony/polyfill-php55                 v1.3.0  Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions
symfony/polyfill-php56                 v1.3.0  Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70                 v1.3.0  Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util                  v1.3.0  Symfony utilities for portability of PHP codes
symfony/polyfill-xml                   v1.3.0  Symfony polyfill for xml's utf8_encode and utf8_decode functions
symfony/swiftmailer-bundle             v3.0.1  Symfony SwiftmailerBundle
symfony/symfony                        v3.2.9  The Symfony PHP framework

But when we try to upgrade to symfony 3.3 and use the new symfony/webserver-bundle the custom router option does not work anymore:

 app/console server:run 127.0.0.1:8080 --env=test_travis --router=app/config/router_test_travis.php

                                                                                                                        
 [OK] Server listening on http://127.0.0.1:8080                                                                         
                                                                                                                        

 // Quit the server with CONTROL-C.                                                                                     

PHP 7.1.6-1~ubuntu16.04.1+deb.sury.org+1 Development Server started at Fri Jun 16 09:30:21 2017
Listening on http://127.0.0.1:8080
Document root is /path/to/web
Press Ctrl-C to quit.
[Fri Jun 16 09:30:28 2017] PHP Warning:  Unknown: failed to open stream: No such file or directory in Unknown on line 0
[Fri Jun 16 09:30:28 2017] PHP Fatal error:  Unknown: Failed opening required 'app/config/router_test_travis.php' (include_path='.:/usr/share/php') in Unknown on line 0
Symfony packages
symfony/assetic-bundle                 v2.8.1  Integrates Assetic into Symfony2
symfony/monolog-bundle                 v3.1.0  Symfony MonologBundle
symfony/polyfill-intl-icu              v1.4.0  Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring              v1.4.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php56                 v1.4.0  Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70                 v1.4.0  Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-php72                 v1.4.0  Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-util                  v1.4.0  Symfony utilities for portability of PHP codes
symfony/polyfill-xml                   v1.4.0  Symfony polyfill for xml's utf8_encode and utf8_decode functions
symfony/swiftmailer-bundle             v3.0.3  Symfony SwiftmailerBundle
symfony/symfony                        v3.3.2  The Symfony PHP framework

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions