1

I just installed my SYmfony app on a server and the images are not displayed. I tried no modify the access rights on the web folder but it didnt work.

What is the good way to configure access on a server with a symfony project ?

I display my image like this :

<div class="user-info" style="background-image:url({{ asset('bundles/app/images/header/userbg.jpg') }});">
    <div class="image">
        <img src="{{ asset('uploads/')~user.image }}" width="48" height="48" alt="User" />
    </div>
</div>

enter image description here

The html code generated is like this :

<div class="user-info" style="background-image:url(/bundles/app/images/header/userbg.jpg);">
    <div class="image">
        <img src="/uploads/empty-profile.png" width="48" height="48" alt="User">
    </div>
</div>

I don't understand the good way to manage images on my app. It is displayed well on my local server.

enter image description here

Gauthier
  • 1,116
  • 2
  • 16
  • 39
  • What are your permissions right now? And are you sure it's a permission problem, not your Symfony firewall? – Stephan Vierkant Dec 04 '17 at 12:54
  • @StephanVierkant It could be, I have no idea... I updated my post with the file permissions – Gauthier Dec 04 '17 at 13:02
  • What if you open userbg.jpg? Does it show a Symfony error or from your webserver? – Stephan Vierkant Dec 04 '17 at 13:05
  • I have the following message : Forbidden : You don't have permission to access /bundles/app/images/header/userbg.jpg on this server. – Gauthier Dec 04 '17 at 13:06
  • Using Apache? Have you seen this question? https://stackoverflow.com/questions/10873295/error-message-forbidden-you-dont-have-permission-to-access-on-this-server – Stephan Vierkant Dec 04 '17 at 13:07
  • I was just on it but I'm not sure about what tot do. Should I modify the .htaccess ? Because I'm currently using the default one provided by Symfony – Gauthier Dec 04 '17 at 13:14

0 Answers0