WEB HOSTING SUPPORT NETWORK
     
 

Setting permissions

Here you can find how to set file permissions for some of the most common web files and folders: pages, Perl and PHP scripts and data/config files, images and folders. Sometimes, incorrectly configured permissions may be a reason for "Forbidden" and "Internal Server Error" messages.

In general, you need to have the following permissions for the files and folders on your site:

  • PHP scripts, pages and images should be readable/writable by the owner and readable by the web visitor. This means that all HTML pages you have can be with permissions of 644 or higher - 664, 755, etc.
  • Perl scripts should be readable/writable/executable by the owner and readable/executable by the web visitor - 755.
  • data-config files can be readable/writable only by the owner - 400, 600.
  • folder on your site must be readable/writable/executable by the owner and readable/executable by the web visitor - 755.

Below is a brief explanation of what these numbers mean.

  • --- (or 0) means no permission
  • r-- (or 4) means read-only permission
  • rw- (or 6) means read/write permission
  • r-x (or 5) means read/execute permission
  • rwx (or 7) means read/write/execute permission

So, for example, 664 (rw-rw-r) represent the following permissions - read/write for the owner, read/write for the group, and read for the public (everyone else).

Most scripts or installation instructions require that you CHMOD your script to 755. This means that you need to set its file permissions to 755.

Note: File permissions higher than 775 are not necessary - both 755 and 775 will work.

You can find detailed instructions on how to change file permissions using the Control Panel's File Manager section in the File Manager article from our online documentation.

If you wish to change file permissions using your FTP software:

1. Log into your account and go to the directory where the files are located.

2. Highlight the file that you want to change permissions for.

3. Locate the "file permission" or "chmod" command on your FTP software (you may need to refer to the manual or help file) and apply the needed permissions. There should be three groups. Each group should have either checkboxes or a selection for the permission type.

permissions.gif

Usually, there will be a text box where you can type in the desired permissions - 775 for example and 3 sets of checkboxes.
The first set of check boxes applies permissions for the "Owner", the second for the "Group" and the third for the "Public".

You need to type or select the desired permissions and click OK. Your FTP program will update the file permissions on the server.