Understanding File Permissions and Fixing Permission Errors

Print
  • 0

What file permissions are

Every file and folder on your hosting carries a set of permissions, a rule for who is allowed to read it, change it, or run it. It is the server's way of keeping things orderly and secure: the right things can be accessed, the wrong things cannot. Most of the time permissions are set correctly without you ever thinking about them, and you never need to look. You end up here when something has gone wrong, and a permission error is the symptom.

What a permission problem looks like

  • A 403 Forbidden error, the server refusing to show a page it should.
  • An "internal server error" that turns out to be a permissions issue behind it, as our article on 500 errors touches on.
  • WordPress or another application unable to upload files, write to folders, or save changes.
  • A file or page that simply will not load, or will not let you edit it.

These usually appear after a file has been moved, uploaded, or restored, or after something changed permissions that should not have, which is when the tidy default gets knocked out of place.

The standard settings, in plain terms

You will see permissions written as three-digit numbers, and the two that matter cover almost everything:

  • Files should normally be 644. Readable by all, changeable only by you.
  • Folders should normally be 755. Readable and enterable by all, changeable only by you.

That is the standard, safe arrangement for a website, and most permission errors are simply a file or folder that has drifted away from these values. You do not need to understand the number system in depth, you need to know that 644 for files and 755 for folders is the normal, correct state to return things to.

The one fix that's safe to do yourself

If a specific file or folder has the wrong permissions, you can correct it in cPanel's File Manager:

  1. Log in to cPanel at yourdomain.tld/cpanel and open File Manager.
  2. Find the file or folder, right-click it, and choose Change Permissions.
  3. Set it to 644 for a file or 755 for a folder, and save.

That resolves the common case: one item with the wrong permissions, set back to standard. It is safe because you are returning something to its correct state, not inventing a new one.

What to be careful about

Two temptations to resist, because they cause more harm than the problem they are trying to fix:

  • Never set permissions to 777. If you search the internet for a permission error, you will find advice to "just set it to 777," which makes a file writable by anyone at all. It often does make the immediate error go away, and it opens a genuine security hole that attackers actively look for. It is the wrong fix, every time. If something only works at 777, the real cause is elsewhere, and that is for us to sort out, not for you to paper over.
  • Be wary of changing permissions on many files at once. Applying a permission change recursively, to a folder and everything inside it, is where people accidentally break a whole site, because files and folders need different values and a blanket change gets one of them wrong. One file or folder at a time is safe; sweeping changes are not.

When to let us handle it

If correcting a single file or folder to 644 or 755 did not fix it, if lots of files have wrong permissions at once, or if you are tempted by anything involving 777 or a recursive change, stop and open a support ticket. Permission problems that span many files usually have an underlying cause, how a site was uploaded or restored, a script behaving badly, and we can reset everything to the correct values safely and find why it happened. This is quick and routine for us, and it avoids the real risk of making a site less secure while trying to fix it.

Good to know

The whole of file permissions, for practical purposes, comes down to one thing worth remembering: files are 644, folders are 755, and 777 is never the answer. If you keep only that, you can fix the common single-file case yourself and know to call us for anything bigger. Permission errors look alarming and are usually simple, a value knocked out of place, set back where it belongs, and the one genuine danger is not the error itself but the bad advice about fixing it that is all over the internet. When in doubt, the standard values or a ticket beat a risky shortcut every time.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution