1
votes

I deployed a symfony 3.4 project from my local machine (Windows 10) to a cloud server (Digital Ocean) based on Ubuntu.

I spent 2 days trying to resolve this (i think) routing problem:

"request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader..."

Locally, on localhost with XAMPP, it works perfect.

The project runs ok on the login (is like a backend user app), with the register ok But when it tries to pass the login, it needs to load the initial dashboard with some includes (like nav_side.html.twig) and the server response is error 500.

How can i fix it?

Thanks a lot for your response...i'm a little bit desperate. :)

I made composer update, i deleted the cache folder, but the error is still there.

request.CRITICAL: Uncaught PHP Exception Twig_Error_Loader: "Unable to find template "Backe ndBundle:includes:nav_side.html.twig" (looked into: /var/www/onecup/app/Resources/views, /var/www/onecup/vendor/s
ymfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in "BackendBundle:Dashboard:index.html.twig" at line 7." at /var/www/onecup/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 234 {"exception":"[object] (Twig_Err or_Loader(code: 0): Unable to find template \"BackendBundle:includes:nav_side.html.twig\" (looked into: /var/www/ onecup/app/Resources/views, /var/www/onecup/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in \"BackendBundle:Dashboard:index.html.twig\" at line 7. at /var/www/onecup/vendor/twig/twig/lib/Twig/Loader/Fil
esystem.php:234)"} []

1
Hi Mauricio, have you configured the corresponding server file to read from the public folder? have you deleted the .env or .env.local file and repositioned its variables in the previous configuration file?M. Galardi
Strange that is worked in development but not production. Go ahead and verify that this answer is not relevant. And of course verify that your views/includes directory got uploaded. Also verify the file name case is correct since Windows is case insensitive. And the space in "Backe ndBundle seems a bit suspicious though I assume it is a copy/paste sort of thing.Cerad
Doing "composer update" in production is a bit dangerous. You should be uploading the composer.lock file from your development machine and using "composer install" to ensure you get identical versions of third party software. Plus make sure the php versions match.Cerad
@Mauricio examine your code and try to find possible case inconsistences in directory / filenames. e.g. "file" and "File". Windows filesystem is case-insensitive, but Ubuntu filesystem is case-sensitiveFlying
its not able to find nav_side.html.twig, try BackendBundle:includes\nav_side.html.twigGiray Kefelioglu

1 Answers

2
votes

@Flying was right: examine your code and try to find possible case inconsistences in directory / filenames. e.g. "file" and "File". Windows filesystem is case-insensitive, but Ubuntu filesystem is case-sensitive.

So, i changed the Includes to includes and that's all.

Thanks a lot!! :)