4
votes

I want to deploy a symfony project to production but I get the following exception

Fatal error: Uncaught exception 'Twig_Error_Loader' with message 'The "/home/technqoc/public_html\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle/Resources/views" directory does not exist.' in /home/technqoc/public_html/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:93

I suspect it's because of the way the server is trying to access the directory. How can I change the backslash to forward slash in the directory path?

2
Can you actually navigate to a folder called /home/technqoc/public_html/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views? If not, did you remember to install all the vendor dependancies on your production server ($ php composer.php install)?HPierce
I can navigate to it but, if you notice, the directory in my question uses forward slashes until "public_html" then it uses backslashes. "/home/technqoc/public_html" is my root directory in the production server. I have copied my files into this root directory. so it seems the server can't find "\vendor" how can I change things so that the server looks for "/vendor" instead?CodeSlave

2 Answers

5
votes

Simply clear any file and folder in cache directory.

4
votes

As @HPierce pointed out, I think you have to run "composer install" to rebuild the autoloader according to your local environment, or it will try to use the folder structure of another server.