What read, write and execute mean
Every file and folder on Linux hosting has three sets of permissions: one for the owner (your cPanel account), one for the group, and one for others, which means everyone else on the server.
ls -l shows them as nine letters, such as rwxr-xr-x: three for the owner, three for the group, three for others. A dash means that permission is off. cPanel File Manager shows the same as a number, such as 0755; you can ignore the leading 0.
- Read (
r): view a file, or list what is in a folder. - Write (
w): change or delete a file, or add, rename and delete files in a folder. - Execute (
x): run a file as a program, or open a folder and reach the files inside it.
What chmod 755 and 644 mean
Each permission has a number: read is 4, write is 2 and execute is 1. Add them up for each set. The three digits are the owner, the group and others, in that order.
7= 4 + 2 + 1 =rwx: read, write and execute.6= 4 + 2 =rw-: read and write.5= 4 + 1 =r-x: read and execute.4=r--: read only.0=---: no access.755isrwxr-xr-x: the owner can do everything, and the group and others can read and open, but not change.644isrw-r--r--: the owner can read and write, and everyone else can only read.
The right permissions for a website
On most cPanel hosting, PHP runs as your own account. These settings let your site run while no one else can change your files.
- Folders:
755. - Files, including
.php,.html, images and.htaccess:644. - Config files that hold passwords, such as
wp-config.php:600or640. Once you no longer edit it,440or400, if your site still loads. - Scripts you run directly, such as CGI scripts in
cgi-bin:755. - Leave
public_htmlitself as your host set it. On cPanel it is often750. - Never use
777or666. Anyone on the server could change the file, and many servers refuse to run PHP that others can write to.
How to change permissions in cPanel File Manager
Back up before you change permissions on many files, and note the old numbers so you can set them back.
- In cPanel, open Backup and download a home directory backup.
- Open File Manager and go to your site’s folder, usually
public_html. - Read the Permissions column to see each file’s and folder’s current number.
- Select a file or folder, then select Permissions in the toolbar.
- Tick read, write and execute for User, Group and World until the number reads
755for a folder or644for a file. - Select Change Permissions, then load your site.
How to chmod over SSH
To fix a whole site at once, open Terminal in cPanel, or connect with an SSH client using the details in your welcome email or client area.
- Go to your home folder:
cd ~. - Back up first:
tar -czf site-backup.tar.gz public_html. This saves a copy of your files, with their permissions, outsidepublic_html. - Change one item:
chmod 755 public_html/imagesfor a folder, orchmod 644 public_html/index.phpfor a file. - Set every folder inside
public_html:find public_html -mindepth 1 -type d -exec chmod 755 {} +. - Set every file:
find public_html -type f -exec chmod 644 {} +. - Lock WordPress’s config again:
chmod 600 public_html/wp-config.php. - Set any CGI scripts back to
755. - Check with
ls -l public_html: folders showdrwxr-xr-xand files-rw-r--r--, exceptwp-config.phpat-rw-------. Then load your site. - Avoid
chmod -R 755. It makes every file executable too.
403 Forbidden and 500 errors from wrong permissions
Most permission errors come from a setting that is too tight for the web server, or too open for PHP.
- 403 Forbidden: the web server cannot read a file or open a folder, often one set to
700or600. Set folders to755and files to644. - 500 Internal Server Error: some servers refuse to run PHP from a file or folder others can write to, such as
777. Set folders back to755and files to644. For other causes, see how to fix the WordPress 500 error. - In cPanel, open Errors under Metrics to see which file the server refused.
- “Unable to create directory” in WordPress: set
wp-content/uploadsand the folders in it to755. - Still blocked? The files may belong to the wrong owner, which you cannot change from cPanel. Open a support ticket.
HostUpIndia Web & cPanel Hosting
HostUpIndia Web & cPanel plans include cPanel with File Manager and terminal (SSH) access for the steps above, on LiteSpeed with NVMe storage and free SSL. Daily backups kept 30 days give you a restore point if a change goes wrong.
- From ₹49 a month on 3-year billing. Prices exclude 18% GST. See Web & cPanel plans.
- Support tickets and email are received 24 hours a day, 7 days a week; WhatsApp is open for questions from 10 am to 7 pm IST, Monday to Saturday.
- Free website migration by the HostUpIndia in-house team.
- New to File Manager? See how to use cPanel File Manager.
- More help guides.
