Laravel storage:link Not Working on cPanel? Images Missing After Deploy
I recently deployed a Laravel project to shared hosting using cPanel, and suddenly all uploaded images disappeared.
The strange part was:
- everything worked locally on Windows
- images physically existed on the server
- but production kept showing broken image icons and
403 Forbiddenerrors
At first, I thought the issue was related to:
- Blade templates
- image uploads
- Laravel storage
- or browser cache
But the real issue turned out to be related to:
- symbolic links (
storage:link) - Linux permissions
- Apache restrictions
- and shared hosting security settings
Some useful debugging steps included:
```bash id="d7u0f0"
php artisan optimize:clear
and:
```bash id="d5m7kc"
chmod -R 775 storage bootstrap/cache
I also had to manually inspect:
.htaccess- symlink targets
- and direct image URLs
The issue became even more confusing because:
- old images sometimes worked
- new uploads failed
- and direct URLs returned
403 Forbidden
I documented the full debugging process and final solution here:
If you're deploying Laravel on shared hosting and images suddenly disappear, this may save you hours of debugging.
Top comments (0)