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

Zoul's avatar
Level 5

Images not showing after deploying the app to cPanel

Hi, I ran php artisan storage:link and i got my images folder in public_html/storage/app/public/images/ populated in public/storage/

in public/index.php

if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) {
    require __DIR__.'/../storage/framework/maintenance.php';
}

require __DIR__.'/../vendor/autoload.php';

$app = require_once __DIR__.'/../bootstrap/app.php';

$kernel = $app->make(Kernel::class);

$response = tap($kernel->handle(
    $request = Request::capture()
))->send();

$kernel->terminate($request, $response);

Any idea please ? Many thanks

0 likes
6 replies
Snapey's avatar

dont host you project inside public_html

1 like
Zoul's avatar
Level 5

@Snapey this is the default folder comes with cPanel where we place our project, You mean its better to create another folder and move my project inside it for a security reason ?

Snapey's avatar

@Zoul security yes, but also so that your routes and images work correctly

Zoul's avatar
Level 5

Thanks @Snapey, the question is, i would still need to know why its not working, because if i create another folder named example_folder,i would put my app inside it, and would still need to figure it out how it works

the current structure:

public_html
	+ .git
	+app
	+bootstrap
	+config
	+database
	+public
	+resources
	+routes
	+storage
	+tests
	+vendor
Snapey's avatar
Snapey
Best Answer
Level 122

@Zoul My recommended approach

Create a project folder alongside public_html folder

Make sure public_html does not contain anything you need

delete public_html

Create a symlink making public_html a link to the laravel project public folder

ln -s -n -f ~/www/your-project-folder/public  public_html
Zoul's avatar
Level 5

Many thanks @Snapey, for now i did upload the whole app via file uploader and came along with storaages files, i will try apply your method as its good practice to keep the app secured

Please or to participate in this conversation.