0

Once my web application is running on local, I want to pour it into a server. Whenever I upload it, I'm having problems with the routing staff.

I guess it is searching on local routes (in full paths) instead of server ones.

So this is the error given:

Warning: file_get_contents(C:\xampp\htdocs\MyApp\src\MyBundle/Resources/views/Default/index.html.twig): failed to open stream: No such file or directory

Obviously, it is mixing Windows routing(computer) with Linux paths (server). I have been looking for the config files or whatever, searching in the routing files but nothing changed.

*Edit: I am currently using 2,8 version of Symfony

Gabri_Neno
  • 33
  • 6
  • Have you execute `cache:clear` console command after moving your project? – Muriano May 20 '16 at 12:10
  • 1
    Definetly that was the problem...so embarrasing – Gabri_Neno May 20 '16 at 12:16
  • You shouldn’t be embarrassed. It happens periodically to every one of us. When it’s not the Symfony cache anymore, it’s the OpCache, or Memcache, or the reverse proxy. – Olivier 'Ölbaum' Scherler May 20 '16 at 12:23
  • Read [How to Deploy a Symfony Application](http://symfony.com/doc/2.8/cookbook/deployment/tools.html) – gp_sflover May 20 '16 at 12:45
  • I have added this case to the troubleshooting checklist for this problem here : http://stackoverflow.com/questions/36577020/failed-to-open-stream-no-such-file-or-directory/36577021#36577021 . Please feel free to suggest edits for this case – Vic Seedoubleyew May 22 '16 at 18:16

1 Answers1

2

First, you should make sure you’re not uploading the app/cache directory, or that you’re clearing the cache after uploading.