How do I set file permissions for files, scripts, or directories?

<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->

After uploading, the file permissions for any CGI scripts should be set to 755 (rwx-rx-rx), in order to make them executable. For many CGI scripts it is also important that the permissions are set correctly for any files or folders which they need to access. For example, if a CGI script needs to write to a log file, then this log file will need to have write access enabled. If a CGI script needs to create, delete or rename files, then it will need write permission for the folder in which this is to be done. The following are abbreviations for permissions: --- (or 0) = no permission r-- (or 4) = read-only permission rw- (or 6) = read/write permission r-x (or 5) = read/execute permission rwx (or 7) = read/write/execute permission Sometimes you'll see these numbers referenced for a script. For instance, "chmod your script to "755".

 Permission "777" (NOTE: DO NOT SET YOUR PERMISSIONS TO ANY EXECUTABLE FILES TO "777" BECAUSE YOUR PHP AND CGI SCRIPTS WILL NOT FUNCTION PROPERLY)

That means "set file permissions to "Read-Write-Execute/Read-Execute/Read-Execute". "755" is in fact the most common setting for CGI/Perl scripts - if your script does not work or you get an "Internal Server Error" when you run it try running the script with 755 permissions first. To change file permissions using your FTP software: Log into your account and go to the directory where the files are located. Highlight the file that you want to change permission. Locate the "file permission" or "chmod" command on your FTP software (if you are using WS FTP, highlight the file, right click and choose "chmod"). There should be three groups. Each group should have either checkboxes or a selection for the permission type. Set pages to rw- for the owner, no permission for the group, and r--for other. Set scripts to rwx for the owner, r-x group, and r-x for other.

Was this answer helpful?

 Print this Article

Also Read

Where do I upload my site files?

Please note that you need to upload your site files to remote folder/host directory...

What is my FTP username and password?

All of the necessary login info for your FTP, Site Control Panel, and Customer Support is...

I keep getting an error when trying to FTP

<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal...

Where do I upload my site files?

Please note that you need to upload your site files to remote folder/host directory...

We offer unlimited FTP accounts.

We offer unlimited FTP accounts with any of our plans.