user3588645 user3588645 - 2 months ago 13
PHP Question

Vagrant + Symfony2 Environment ContextErrorException Weirdness

I've never had a problem with either Symfony2 or Vagrant before this point and I'm absolutely lost as to what is happening.

Without any warning my environment died completely and will only produce the following error:

ContextErrorException: Warning:
failed to open stream: No such file or directory in /var/www/project-web/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 130

The reason this is strange is that Symfony is referring to my local file system...


....instead of the box environement which is running Ubuntu, then referring to the unix filesystem location of 'Filesystem.php'...


I cannot get past this screen. I have just created a brand new environment and packaged it as a its own box, then using that box I still get this error.

Can anyone help?


My first guess is you have run it locally first and the paths are in the cache. If so it should be fixed by running the following in your vagrant environment:

php app/console cache:clear

Add --env=prod if you are running the app.php rather then app_dev.php.