Contents
A user uploads a product photo or an avatar, the app says it was saved, and the page shows a broken image. Open its URL, such as example.com/storage/products/photo.jpg, and you get a 404. The file is on the server; the web path to it is not.
How it works
Laravel stores public files in storage/app/public. That folder sits outside public on purpose, so visitors cannot reach it directly. php artisan storage:link creates a symbolic link (a shortcut) inside public called storage, so public/storage/products/photo.jpg is the same file as storage/app/public/products/photo.jpg. The link is created per machine and does not travel correctly in a ZIP or through Git, which is why it works locally and fails on the hosting.
Check first
Open File Manager, go into your project’s public folder and enable Show Hidden Files:
- Nothing called
storage: the link was never created. Go to cause 1. - A normal
storagefolder (with files or empty): a folder uploaded from your computer, not a link. Cause 2. - A link (different icon or type “link”): it exists; the problem is its location or APP_URL. Causes 3 and 4.
Causes and fixes
1. The link was never created on the server
Over SSH, from the project folder:
php artisan storage:link
You should see The [public/storage] link has been connected to [storage/app/public].
Without SSH: open Cron Jobs in cPanel and add a temporary job that runs every minute, replacing myuser and myapp with your account and folder:
cd /home/myuser/myapp && /usr/local/bin/php artisan storage:link
After a minute, check that the link appears in File Manager, then delete the job straight away. Cron is explained in set up cron jobs.
2. A real storage folder was uploaded into public
Zipping the project on Windows usually turns the link into a plain folder or drops it. Copy any images you need from it into storage/app/public, delete public/storage, and create the link as in cause 1. Otherwise you get The [public/storage] link already exists.
3. The site runs from public_html, not public
If you copied the contents of public into public_html instead of changing the domain’s folder, the command creates the link in myapp/public, which nobody sees. The better fix is to point the domain’s Document Root at myapp/public under Domains in cPanel. If you cannot, create the link by hand in the right place:
ln -s /home/myuser/myapp/storage/app/public /home/myuser/public_html/storage
This line can also run through a one-off cron job in the same way.
4. Wrong APP_URL or wrong disk
Storage::url()builds URLs fromAPP_URL. If it ishttp://localhost, images point at your computer. SetAPP_URL=https://example.com, then deletebootstrap/cache/config.phpor runphp artisan config:clear.- From Laravel 11, the
localdisk saves tostorage/app/private, which is not public. Save images to thepublicdisk, for example$request->file('photo')->store('products', 'public').
5. Permissions, or the save itself failed
If the file is not inside storage/app/public at all, the problem happens before display: saving failed. See file uploads fail because of permissions and Laravel storage permissions.
How to confirm it is fixed
Upload a new image through the app and open its URL in a new tab: the image should show on its own, and the URL should start with your real domain and https.
How to avoid it
- Add
public/storageto.gitignoreand never include it in a ZIP. - Make
php artisan storage:linka fixed step on every new server, as in the Laravel deployment guide. - Point the Document Root at
publicfrom the start.
On ArabyHost
On AI/Developer plans you run php artisan storage:link directly over SSH inside CageFS. On other plans, use the temporary cron job above and check the link in File Manager. If images are still broken, ask the Araby AI assistant to read the error log and explain why. More on running Laravel in Laravel hosting.
FAQ
I get "The public/storage link already exists". What now?
Something called storage exists inside public, and it may be a plain folder uploaded from your computer rather than a link. Delete it in File Manager once you are sure it holds nothing you need, then run the command again.
Should I just move the images into public instead?
Better not: deploying a new version of the project can wipe that folder with everything in it. The symlink keeps files in storage, which deployments leave alone.
Why do image URLs show localhost?
Storage::url builds the URL from APP_URL in .env. Set it to your real https address, then clear the config cache.