Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

Always use the command line IN your vagrant box (via ssh), never cmd on the windows path.

vagrant up
vagrant ssh
... some auth ...
cd /your/project/path
php app/console ...

I'm using Homestead with Symfony 3.1.

I had to delete var/cache folder from the root of my project in the host machine.

rm -rf var/cache/ solved it.

Before, I tried out php app/console cache:clear with no results.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top