Skip to main content

Timeline for Symfony 3 cant find my .svg icons

Current License: CC BY-SA 3.0

6 events
when toggle format what by license comment
Aug 8, 2016 at 11:04 comment added GiantJelly Hey Alvin. Its resolved now as you can see in my answer below. The document root is /var/www/project/web i removed the html directory form document root as I wanted a clearer directory list. Thank you for all your help
Aug 7, 2016 at 0:12 comment added Alvin Bunk Is "www" your Symfony project name? If so, that's probably the problem. The "web" folder under that folder is the one you need to use as the web folder config on your server. If it is ubuntu, it is probably "/var/www/html/www/web" that you would specify in your Apache DocumentRoot directive.
Aug 6, 2016 at 10:34 comment added GiantJelly I have tried searching the url {address}/icons/weather/cloud.svg on my ubuntu server and i get a "Not found" page. I then search the exact same thing on my windows server and it loads the .svg to me. Ive ran chmod across the whole www folder to rule out permissions. I still have no idea what this could be, Could symfony use a folder called "icons" and get confused or something? The icons are at www/web/icons/weather/cloud.svg
Aug 3, 2016 at 14:40 comment added Alvin Bunk And the icons folder is it directly under your web root folder? I'm thinking you get the 404 error because of the path, which probably should be icons/weather/cloud.svg. Try entering that URL directly in your browser to see that you can actually grab the file. If you don't have access to a browser, try curl or wget commands (from command line). You need to understand why the 404 error - because that also could be a permissions error (it's possible).
Aug 3, 2016 at 11:08 comment added GiantJelly That gives me a 500 error. Which is basically a php error. I messed around with the syntax which didnt work and then i did <img src="{{ asset('icons/weather/cloud.svg') }}" /> which shows <img src="/icons/weather/cloud.svg"> in inspect but i still get my 404 error. :/
Aug 2, 2016 at 23:35 history answered Alvin Bunk CC BY-SA 3.0