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

andrew123K's avatar

Laravel storage:link not working on remote server

Hello, guys, Laravel php artisan storage:link not working on remote server. Locally all working perfectly. This is my config/filesystems.php:

    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
        'throw' => false,
    ],

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

],

'links' => [
    public_path('/icons/') => storage_path('app/public/avatars/'),
    
],

On hosting, files are uploaded in folder storage perfectly, but not appear in folder public/icons. I try to fix that and run command: php artisan storage:link on remote server and get response:

The [public/icons/] link already exists.

After that, I removed public/icons/ folder and run command:php artisan storage:link again and get response: In Filesystem.php line 335 symlink(): No such file or directory

Any ideas how to fix that? Thank you.

PS: 1/ Site is located on domain: app.mydomain.com. 2/ My laravel site located inside /public_html/app/ 3/ In env: APP_URL=https://app.mydomain.com 4/ Permission of folder public/icons is 755.

0 likes
1 reply
vincent15000's avatar

It's a very bad idea to put all your application in the public folder.

/public_html/app/3/

Doing so you give access to several sensitive datas.

And that's also probably why the php artisan storage:link command doesn't work.

Please or to participate in this conversation.