How to change permissions (chmod) of a filePermissions can be very important when it comes to hosting your website. Permissions can allow our server computer to write and edit your files. Along with that, some files need to be protected from writing and editing, as a security measure. You can change your file permissions in many ways.
Using File ManagerOne of the easy and basic ways to change the permissions is through File manager in cPanel. To change the permissions for a file or folder in cpanel, please do the following:
- Click File Manager
- Click the name of the file for which you would like to change the permissions.
- Select the Change Permissions link at the top right of the page.
- Select the permissions you would like to set for the file.
- Click Change Permissions
Using FTPConnect to FTP. Go to the file and right click. Choose Permissions or Attributes or Properties (depends on your program).
Using SSH or a scriptThis can be done with chmod command.
AdvancedA common concern is using file permissions of 777.
HostGator does not allow 777 on files which process server-side (i.e. PHP). However, many scripts require you to change your files to 777.
I can tell you that 755 will work in lieu of 777. You will not need to use 777 on PHP files or folders.