dont host you project inside public_html
Sep 12, 2024
6
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
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
Please or to participate in this conversation.