Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kikter's avatar

Images not displaying on shared hosting

I'm using laravel 9 so I just deployed it on namecheap server so I run this command php artisan storage:link my images are not showing but when I open my public folder the image are been stored there

0 likes
8 replies
Sinnbeck's avatar

Is your public folder (where index.php is) in public or public_html?

Sinnbeck's avatar

@kikter Phew. Thats good at least. But do you need to have /public in your url to access it? Generally you want your files below public_html, and then point to your public dictory as root (or symlink your public_html to public)

kikter's avatar

@Sinnbeck this is how I am getting my image

@foreach ($thread->images as $image)
          <div class="">
              <img src="{{ Storage::url($image->filename) }}" alt=""
                  class="w-full @if ($loop->iteration == 3)   @endif rounded-t-md h-44">
          </div>

      @endforeach
kikter's avatar

@sinnbeck still not working when I use this

<img src = "{{ asset('/storage/'.$image->filename) }}" />

Please or to participate in this conversation.