Hosting and cPanel
Correct permissions for directories and files
For a website's public files, normally use 755 for directories and 644 for files. The account's PHP processes run as its owner, so you don't need to give everyone write access with 777.
What those values mean
- 755 on a folder: its owner can modify it; the other permissions allow reading and traversing it when the remaining controls allow it.
- 644 on a file: its owner can modify it; others can read it when they have access to its path.
- 777 also lets other users write. It isn't a suitable fix for an application error.
Don't apply 755/644 indiscriminately to the whole account. Private keys, configuration files with secrets and certain directories need more restrictive permissions. Executables may need execute permission; follow the specific instructions for each tool.
Fix a write problem
- Identify the exact path shown in the error.
- Check whether it's a file or a directory and note its current permissions.
- From cPanel > File Manager, select it and open Permissions. Apply the value that suits that content.
- Repeat the operation that was failing and check the result.
If it still fails, check the file's owner, the disk quota, the path and the application's restrictions. Changing permissions doesn't fix a wrong owner or a full disk. Give us the path and the error if you need help; avoid recursive changes on mail, .ssh or the whole home folder.
You may also find useful
- File Manager Manage files and folders from cPanel with actions to create, edit, search, compress, move, change pe...
- Network drive (Web Disk) Set up Web Disk to use your hosting files as a network drive, with separate accounts, limited direct...
- Upload files and folders to cPanel with a ZIP Upload files or folders in one go from cPanel by compressing the content on your computer, uploading...
- FTP access, management and separate accounts Connect to your hosting over SFTP or FTPS, create FTP accounts restricted to specific directories an...
Something wrong or out of date? Tell us and we will review it.