5

i just updated my symfony version from 3.4.1 to 3.4.2 using composer update command(all OK).

when i tried to start the server i receive the following message:

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 45

Fatal error: require(): Failed opening required 'index.php' (include_path='C:\xampp\php\PEAR') in (...)vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle\Resources\router.php on line 45

It makes reference to this peace of code

$script = getenv('APP_FRONT_CONTROLLER') ?: 'index.php';

//var_dump(getenv('APP_FRONT_CONTROLLER'));
//die();

    $_SERVER = array_merge($_SERVER, $_ENV);
    $_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.$script;

    // Since we are rewriting to app_dev.php, adjust SCRIPT_NAME and PHP_SELF accordingly
    $_SERVER['SCRIPT_NAME'] = DIRECTORY_SEPARATOR.$script;
    $_SERVER['PHP_SELF'] = DIRECTORY_SEPARATOR.$script;

    require $script; //<==== HERE!!!

When I make a dump in the $script variable my result is false(there is no env variable called APP_FRONT_CONTROLLER) but when I run the server in another 3.4.1 symfony version the result is

string(11) "app_dev.php"

and all works fine.

Is this an issue of the version or a problem from my env.

If you need more information just ask for it.

thanks in advance.

1
  • Is this a flex app or a standard framework app? Is it a new 3.4.1 app or did you previously upgrade from an earlier version? And you are using bin/console server:start or run? Commented Dec 15, 2017 at 16:22

1 Answer 1

5

This is a bug in 3.4.2 and was already reported:

https://github.com/symfony/symfony/issues/25515

So only option for now are either downgrading to 3.4.1, use another webserver or fix it and submit a PR.

Sign up to request clarification or add additional context in comments.

5 Comments

Oops. I just deleted my comment. I upgraded 4.0.0 to 4.0.2 and it worked fine. Did not try 3.4 yet. And I just found out that if I delete a comment then comments that reference it are deleted as well. Fun stuff.
Ah yeah, i'm guessing the problem has something to do with the BC layer then for the old structure. Edit: nah i just deleted mine then too since it seemed no longer relevant :D
I just updated 3.4.1 using the old standard framework style to 3.4.2 and server:start seems to work just fine.
Interesting. So it's not a general error that's somehow good and bad at the same time. Hopefully the team will figure this out for all those affected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.