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

CruiseLee's avatar

After deploying: images are missing. Path probably wrong?

Hi together!

I have a little trouble with some configurations after deploying my project to a shared server. My images are not found/shown anymore. While the css is showing all fine, there are no pictures anymore. I made a symlink by calling php artisan storage:link. I tested it. Worked fine in my file manager. Thus there must be an fail in the configuration of my storage path. While uploading new pictures it saves/creates correct paths in the storage folder. The images are on the right places.

in my blades img-tags like: {{ asset('/storage/images/fotos/'.$item->com_id.'/'.$item->bw_id.'/'.$img->fotoname)}}

structure of my project:

root

|_ project-folder

|_ public_html

........ |_ project

................ |_ index.php

................ |_ symlink-to-storage-folder

How do I fix this issue?

Thank you for your helps!

0 likes
16 replies
mkojoa's avatar

The problem is, storage is not accessible on the web. To make them accessible from the web, you should create a symbolic link from public/storage to storage/app/public. you can take a look at php artisan storage:link for creating a symbolic link. once the symblic is created used asset('storage/file.txt');. remove the / infront of the storage. you sould have something like {{ asset('storage/images/fotos/'.$item->com_id.'/'.$item->bw_id.'/'.$img->fotoname) }}

CruiseLee's avatar

Yeah, that's correct. Sorry about my wrong structure shown before. Now I updated it. My images are placed above the public_html... But why the images aren't shown, while the css is working?

1 like
jlrdw's avatar

In my above Reply look at the last link it gives an example. If they are underneath public_html you won't need the SYM link.

CruiseLee's avatar

My folder structure is correct at all. project-core parallel to the public_html. The index ist also correct. The page is working, the storage writable (Upload is working), database connection is workin, mail configurations are fine, the symlink correct. The css is working, the fonts are correct... There are only the images which aren't shown.

what are other possible issues?

1 like
jlrdw's avatar

Rather than go over numerous examples about a week ago this was discussed in detail please read through some of these replies here https://laracasts.com/discuss/channels/laravel/symlink-has-been-disabled-for-security-reasons-1

But if on shared I'd suggest just put them under public_html.

Just put the correct URL in that asset helper.

I have used the asset helper for quite a while now, and really never had any problems. But yes there's a couple times I had to use a little trial and error and get the url resolved correctly.

Snapey's avatar

check the path that is specified in the html source

compare to the path of the file

make sure you don't have any issues with upper/lower case

remember, if your image is correctly symlinked in /storage then you should be able to put the url in your browser address bar and load the image

1 like
CruiseLee's avatar

@jlrdw on this host symlinks are enabled and its supporting laravel. Via ssh I could properly create one with success. Thank you anyway. Have a nice weekend

MarianoMoreyra's avatar

Hi @cruiselee

Just in case, when you deployed your project, you kept the same IDs for the $item->com_id and the $item->bw_id right?

Have you tried what @snapey suggested about pasting the url to one of those images directly in your browser and see if it's loaded?

CruiseLee's avatar

Hi together

@snapey I get an 403 error by putting the img-url in my browser... could it be that the symlink contains the full absolute path to the storage/app/public folder? How could I fix it?

Edit: ls storage gives me the correct folders in blue...

Snapey's avatar

problem looks like you have an additional folder the root folder and the storage folder.

You just need to work out what url leads to the images. For instance /project/storage/

CruiseLee's avatar

@snapey but then I would have no access to the entire page, isn't it? The webroot for the page is public_html/project, so the image path is shown as www.example.com/storage/image/fotos/34/1025/IMG-15235.jpg, the symlink is at public_html/project/storage to the linkpath project-folder/storage/app/public. Thus for me everything seems to be fine.

please correct me, if I didn't undersood your hint.

the ssh call readlink is give back an absolute path... is that ok? shouldn't it be not a rel path?

thank's a lot

CruiseLee's avatar
CruiseLee
OP
Best Answer
Level 1

Hi all

I solved it by clearing the chache. Sometimes it's nice to know where to seek! ;-)

php artisan config:clear

1 like
uche's avatar

Am facing this ugly experience currently on my web. I have done the above suggestion but I dont really know why all of a sudden all the images disappears. But when I make new post the image remains but old images are gone. Please any other possible suggestion for me?

Please or to participate in this conversation.