-1

I have a webhosting on OVH (pro).

I executed the command :

php artisan storage:link 

But the images do not display.

With the symlink => blank page: https://i.stack.imgur.com/AaFyZ.png

Without the symlink => 404: https://i.stack.imgur.com/XM8MW.png

The website url ( see in my screenshot ) works because i test the new server with my hosts file edited.

Perhaps my htaccess

www/.htaccess : https://www.codepile.net/pile/EvX3lVay

www/public/.htaccess : https://www.codepile.net/pile/1X2xWA0D

Any idea why ?

Yannik
  • 43
  • 8
  • i just ran into the same problem on my project. can you provide the code snippet from your view file where you're trying to access the file? – maximus1127 Aug 05 '19 at 15:17
  • @maximus1127 Thanks for helping :) style="background-image:url('{{ asset('storage/' . $slide->image) }}');" – Yannik Aug 05 '19 at 15:25
  • can you also provide the way the database is storing the path? is it simply storing the file name or is it saving a directory list in the path? similar to "storage/public/filename" instead of just "filename" in the database. – maximus1127 Aug 05 '19 at 15:37
  • @maximus1127 like this : zGAltY0JbeKZxnR52uoHFxhTKy2mxdVR6fwamYD5.jpeg – Yannik Aug 05 '19 at 16:06
  • And your sure the image is getting saved to the public directory in the storage folder right? Because the symbolic link is only between storage/app/public and the public folder – maximus1127 Aug 05 '19 at 16:08
  • @maximus1127 yes and the image is detected because if i call a image who don't existe, the server return a 404 error. – Yannik Aug 05 '19 at 16:39
  • @maximus1127 if i remove the symlink and add this route, it's work : https://www.codepile.net/pile/76k57EJp maybe a issue with ovh and the symlink – Yannik Aug 05 '19 at 16:48
  • just for testing purposes, try creating an image with a "src" attribute pointing to your file, see if that generates instead of the background-url. Also, to further test, try accessing your file directly from the storage folder using the storage facade. `````` – maximus1127 Aug 05 '19 at 16:52
  • @maximus1127 same issue :/ I try without the symlink, i have a 404 and with the symlink i have a blank page ... – Yannik Aug 06 '19 at 07:17
  • ah, i'm sorry my friend, apart from everything i've suggested, I don't really know what else could be causing this. perhaps a permissions issue somewhere? but that's just a guess. – maximus1127 Aug 06 '19 at 14:19

1 Answers1

0

It seems like you have a space symbol in your command after the colon:

php artisan storage: link

Please try this one:

php artisan storage:link
  • Hello :) It's a misspelling in my stackoverflow post ^^ The command work on the server and the symlink is created. – Yannik Aug 06 '19 at 13:45