If your website shows a 500 Internal Server Error, a 403 Forbidden message, or a script that suddenly stops working after an upload or restore, incorrect file or folder permissions are one of the most common causes. Permissions control who (and what) is allowed to read, write, or execute a file on the server, and getting them wrong in either direction can break your site or expose it to risk.
What File Permissions Actually Mean
Every file and folder on your hosting account has a permission value, usually shown as a three-digit number. Each digit represents what the file's owner, group, and everyone else can do with it: read, write, or execute.
- 644 is the standard permission for most files (HTML, CSS, images, config files).
- 755 is standard for folders and for scripts that need to run, such as CGI files.
- 777 gives everyone full read, write, and execute access. It sometimes appears to "fix" an error, but it also lets anyone on the server modify or replace your files, so avoid it on a live site.
Never set 777 as a permanent fix. If a plugin or script asks for 777 permissions to work, the correct fix is usually 755 for the specific folder it needs to write to, not the whole site.
How to Check and Change Permissions
In cPanel
- Log in to cPanel and open File Manager.
- Navigate to the file or folder you want to check.
- Right-click it (or select it and click Permissions in the top toolbar).
- In the dialog, either tick the checkboxes for Read, Write, and Execute under Owner, Group, and World, or type the numeric value directly (e.g. 644 or 755) into the permissions field.
- Click Change Permissions to save.
To fix permissions across many files at once (for example, after restoring a backup), select multiple files with the checkboxes and use the same Permissions option, or use File Manager's Select All combined with the change permissions dialog.
In DirectAdmin
- Log in to DirectAdmin and open File Manager.
- Navigate to the file or folder you want to check.
- Tick the checkbox next to it and click Change Permissions (or select the file, then use the permissions icon in the toolbar).
- Enter the numeric permission value, e.g. 644 for a file or 755 for a folder, and confirm.
Quick Reference for Common Files
- Regular files (HTML, CSS, JS, images): 644
- Folders: 755
- PHP scripts: usually 644, unless your hosting setup runs PHP as CGI, in which case 755 may be required
- Configuration files that store sensitive data (e.g. database credentials): as restrictive as your application allows, ideally not writable by "World"
If you're not sure which files were affected, a common trigger is restoring a backup or uploading files through a method that resets permissions. Start by checking the specific file or folder mentioned in your error message before changing permissions site-wide.
For general file uploads and edits, see how to use the cPanel File Manager or the DirectAdmin File Manager.