1

I just created a new project with Symfony (This is not my first time), but when I run the application in the browser, appears this error:

Parse error: syntax error, unexpected '{' in /var/www/ProjectName/var/bootstrap.php.cache on line 2094

If I go to that line in that file there is :

$this->loading[$id] = true;
try {
$service = $this->$method();
} catch (\Exception $e) {
unset($this->services[$id]);
throw $e;
} finally {
unset($this->loading[$id]);
}
return $service;
}

The line 2094 is this piece:

} finally {

What I have to do to make it work?

  • 2
    What version of PHP are you using? The `finally` keyword wasn't added until PHP 5.5. – Jason Roman Dec 21 '15 at 15:11
  • 5
    Yep. And the 'var' indicates you loaded Symfony 3 as opposed to Symfony 2. Probably want to start over and specify Symfony 2.8 instead of the latest. Lots of changes in S3 one of which is that you need at least php 5.5.9. – Cerad Dec 21 '15 at 15:45
  • Check you're php version. http://stackoverflow.com/questions/13690393/finally-exception-gives-an-error-php – Jaime Cardona Villegas Feb 08 '16 at 16:55

0 Answers0