How do I change file permissions?

Setting file permissions is very important in getting CGI scripts to work on your website. Follow the steps below to understand file permissions:

To Begin:

Pages should be readable/writable by the owner and readable by the web visitor.

Scripts should be readable/writable/executable by the owner and readable/executable by the web visitor.

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 reference for a script. For instance, "chmod your script to "755" or "777". 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 this 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 for. Locate the "file permission" or "chmod" command on your FTP software 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 check boxes 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.

  • 0 Користувачі, які знайшли це корисним
Ця відповідь Вам допомогла?

Схожі статті

PHP 5.4 vs 5.3 differences : What to watch out for

Each major release of any framework can make someone begin to second-guess what is still...

How to use the PHP mail function

You can use the PHP mail() function to send an email with PHP. The simplest way to do this is...

Parsing PHP code within HTML pages

The easiest way to parse or run PHP code within an HTML page is to simply change the extension...

Change/Select PHP version

If you require a different version of PHP than which we run by default you can select which...