cPanel & Hosting How-Tos How to Fix File and Folder Permissions in cPanel
Wrong file and folder permissions are behind a huge share of 403 Forbidden and 500 Internal Server errors. The good news: the correct values are simple, and you can set them yourself in cPanel in seconds.
The permission numbers that matter
Permissions are three digits — for the owner, the group, and everyone (public). The safe defaults on shared hosting:
- Folders →
755(owner can read/write/enter; others can read/enter) - Files →
644(owner can read/write; others can read) wp-config.php→640or600(tighter, for the file holding your database password)
Never use 777. It lets anyone write to the file — a serious security risk, and many servers simply refuse to run scripts with 777, producing a 500 error.
Why wrong permissions break things
- Too restrictive (e.g. a folder at 700) — the web server can’t read it, so visitors get 403 Forbidden.
- Too open (e.g. a script at 777 or 666) — the server rejects it for safety, causing a 500 error or a blank page.
Correct permissions fix both at once.
How to set permissions in cPanel
- Open File Manager in cPanel.
- Navigate to the file or folder.
- Select it and click Permissions (or right-click → Change Permissions).
- Enter
755for a folder or644for a file, and save.
Enable Show Hidden Files (Settings, top right) to see .htaccess and other dotfiles.
Fix a whole site at once (FTP)
If many files are wrong — often after a migration — fixing them one by one is slow. In FileZilla, right-click the top folder → File permissions → tick Recurse into subdirectories, then apply 755 to directories and 644 to files separately. See fix FileZilla FTP errors and create an FTP account.
A quick WordPress reference
- All folders: 755
- All files: 644
wp-config.php: 640 or 600- Never set
wp-contentor uploads to 777 — if a plugin “needs” it, that’s a server-side ownership issue to raise with support, not a reason to open the folder to everyone.
Still getting errors?
If permissions look right but a 403/500 persists, check your .htaccess and error logs. Our site-down troubleshooting guide covers the rest.
Every Web Hosting, WordPress Hosting and Reseller Hosting plan at Genhost includes File Manager and FTP, so you can correct permissions yourself whenever an error points to them.
Frequently asked questions
What permissions should files and folders have?
On shared hosting the safe defaults are 644 for files and 755 for folders. WordPress wp-config.php can be tightened to 640 or 600. Never use 777 — it lets anyone write to the file and is a security risk.
Why does the wrong permission cause a 403 or 500 error?
If a file or folder isn't readable/executable by the web server, it returns 403 Forbidden. If a script has insecure permissions (like 777) some servers refuse to run it, causing a 500. Correct permissions fix both.
How do I change permissions in cPanel?
Open File Manager, select the file or folder, click Permissions (or Change Permissions), and set the numbers — 644 for files, 755 for folders. You can also do it over FTP in FileZilla.