theodorusandi's avatar

Jetstream profile picture doesn't show up on CPanel

This works locally but doesn't work when I upload the app to CPanel. I already read some posts about the same issue. I have changed the env file and bind the public to public_html.

Whenever I upload a picture it stored in app/public/storage instread of public_html/storage (from php artisan storage:link)

this is my filesystem config

        'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

My folder structure

  • APP_NAME
    • storage
      • app
        • public
          • the image appeared here
  • public_html
    • storage (from php artisan storage:link) I think its supposed to be here
0 likes
1 reply
theodorusandi's avatar
theodorusandi
OP
Best Answer
Level 1

solved it.

The problem was the folder where the images were uploaded was not connected to the storage folder inside public_html.

so I change this in the config/filesystem.php

'links' => [
        base_path('../public_html/storage') => storage_path('app/public'),
    ],

and then run php artisan storage:link through web routes

Route::get('/linkstorage', function () {
    Artisan::call('storage:link');
});

Similar question

Please or to participate in this conversation.