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

frcam's avatar
Level 1

Saving files in a webhosting with Laravel ?

I have a problem with saving files (photos) with laravel in a web hosting. I can do it in localhost and works perfectly. But now I migrate all project to a web hosting, but saving files is not working.

The form is working, the name of file it's saved, but the file not.

I have this code into my config/filesystems.php:

 'local' => [
        'driver' => 'local',
        'root'   => public_path('web/photos'),
    ],

And I have this folders in public_html/web/photos so whats wrong??

0 likes
3 replies
willvincent's avatar

What are the file permissions of the directory? What user and group are the owner of the directory?

Ideally, you want that directory to have perms 755 and be owned by the user the php process runs as on the server.

Also, I would very surprised if there aren't permissions errors being logged somewhere when the file-write fails.

Please or to participate in this conversation.