Search code examples
phpsymfonytwigassetic

Symfony2 Failed to load resource: [...] 403 (Forbidden) with images in web/uploads/images


I have some trouble to display images on a web page generated using Symfony2 and Twig. I display my images like this :

<div style="background-image: url({{ asset('uploads/images/' ~ imageurl) }});">
    <!-- [...] -->
</div>

-I have 2 versions :

  • local (on my computer) : which is working fine.
  • production : Where I have the error.

-My images are located in /web/upload/images/

-I don't think that it is a permission issue because I have the rights on the folder.

drwxrwxr-x /web
drwxrwxrwx /web/uploads
drwxrwxrwx /web/uploads/images
drwxrwxrwx /web/uploads/images/*

There must be something I didn't configure right but I don't know what I missed...


Solution

  • From all that is written, it looks like permission issue. Please follow official documentation (as there is no need to copy and paste same text) and try to fix it. http://symfony.com/doc/current/setup/file_permissions.html