Menu

Laravel Images Not Showing on cPanel? Fix It in 2 Minutes
📰

Laravel Images Not Showing on cPanel? Fix It in 2 Minutes

DEV Community: laravel·MUHAMMAD Roman Ali·about 3 hours ago
#mqB54x87
#devtolaravel#devto#dev#storage#uploaded
Reading 0:00
15s threshold

You uploaded your Laravel project to cPanel. Everything works, but the uploaded images don't show. You only see broken image icons.

Why it happens

Laravel saves uploaded files in storage/app/public . Browsers can only see them through a link called public/storage . That link doesn't upload with your files, so it doesn't exist on the server.

Fix 1: With Terminal

Open Terminal in cPanel and run:

cd ~/your-project php artisan storage:link

Enter fullscreen mode

Exit fullscreen mode

Refresh your site. Images should now load.

Fix 2: Without Terminal

Add this route to routes/web.php :

Route::get('/make-link', function () { Illuminate\Support\Facades\Artisan::call('storage:link'); return 'Done'; });

Enter fullscreen mode

Exit fullscreen mode

Open yourdomain.com/make-link once. Then delete the route so nobody else can use it.

Still not working?

Check that APP_URL in .env is your real domain, like https://yourdomain.com .

Some hosts block links.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.