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

NKHO's avatar
Level 2

Laravel - Browser gives 404 when image path correctly defined

I recently deployed my Laravel application to a VPS that I purchased, and have (I think) one final error to resolve. After uploading an image, the image is successfully uploaded and stored in the storage directory, but the browser throws a 404 error.

I have run php artisan storage:link on my VPS. I have verified that it indeed is linking public/storage/ to storage/app/public/ by checking in my FTP client as well as via SSH.

I should also note, other images load just fine. It is only images in my storage/... folder.

The code runs just fine on my local production server, and path is exactly the same. For this reason, it makes me think there is a permission error and thats why I haven't pasted any code, but am more than happy to share it if it helps. It is loaded dynamically with jQuery so I thought just showing the GET request would be of more use.

Is there an environment variable or permission I may have neglected to modify after deployment?

0 likes
4 replies
Snapey's avatar

Are you seeing this 404 in the network tools or a 404 page?

Tray2's avatar

I see that you are looking for jpeg so the first thing that pops into my mind is. Are you sure you name the uploaded file to .jpeg and not .jpg?

Snapey's avatar

perhaps a permissions problem?

If apache, try from the root folder of your project;

chgrp -R www-data storage 
chmod -R ug+rwx storage

Please or to participate in this conversation.