Havenswift Hosting Ltd
All guides

File and folder permissions, and why 777 is never the answer

Every file and folder has permissions controlling who may read, write and run it. When something does not work, "set it to 777" is common advice on the internet. It is bad advice, and on our servers it will usually break the thing it was meant to fix.

The correct values

Why not 777

777 means anyone at all may write to it. On a shared server that is an obvious risk, but more immediately: our servers run your site as your own user, so your site already has all the access it needs at 644 and 755. Setting 777 adds nothing you need and the server will often refuse to execute the file at all, producing a 500 error. It is a common cause of the very problem people apply it to solve.

Fixing permissions in bulk

cPanel's File Manager can apply permissions recursively: select the folder, choose Permissions, and apply to files and folders separately โ€“ 644 for files, 755 for folders. Do not apply one value to both.

Files uploaded by the website

Files created by your site โ€“ uploaded images, generated caches โ€“ are owned by your account and will be correct automatically. If you have uploaded files as root over SSH, or extracted an archive created elsewhere, ownership can end up wrong; ask us and we will correct it.

Other guides

Still stuck? Sign in and raise a ticket, and somebody will answer it.

Sign in