user3588645 user3588645 - 17 days ago 7
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:
file_get_contents(/Users/Paul/Sites/Project/htdocs/project-web/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig):
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...

/Users/Paul/Sites/Project/htdocs/project-web/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig


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

/var/www/project-web/vendor/twig/twig/lib/Twig/Loader/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?

Answer

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.

Comments