ysun's avatar
Level 2

Got "chmod(): Operation not permitted" after changing FILESYSTEM_DRIVER from local to public

in the .env

FILESYSTEM_DRIVER=public

in the config/filesystems.php

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

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

however uploaded file did saved into the storage/app/public directory instead of the storage/app after the change. How to resolve this issue.

env: Sail on Windows 10

0 likes
3 replies
Tray2's avatar

Sail runs a linux docker image, and chmod is used to change the permissions on files and directories.

So what this tells you is that laravel isn't permitted to change the permissions to the files.

I suggest you stick with local and try running php artisan storage:link

Tray2's avatar

@ysun Happy that you solved it. Please mark your answer as the best one for future reference.

Please or to participate in this conversation.