File permissions that just work

Applications need to write to a few folders: logs, caches, sessions and uploads. In Laravel these are storage and bootstrap/cache, plus public/uploads in our products.

On most shared hosting, folders at 755 and files at 644 are correct, because PHP runs as your own user. Avoid 777: it lets any process on the server change your files. If your host runs PHP as a different user, ask them to set the owner of those folders to the web server user instead.

0 comments

Leave a comment

Not shown publicly.
Chat with us
Hi! Send us a message and we will reply here as soon as we can.