Correct directory and file permissions
CHMOD (change mode) is a command-line program that lets you change file attributes such as file permissions.
There are three types of permissions that can be configured for files and scripts.
Description | Explanation | Permission codes |
---|---|---|
Read permissions: | permission to read files | (r as in read) |
Write permissions: | permission to make changes to files | (w as in write) |
Execute permissions: | Permission to execute files (programs) | (x as in execute) |
Another way to use CHMOD is with numbers for assigning access permissions. Numbers in the octal system (0-7) are used for this.
Hoststar uses the following default permissions:
Directory | Permission codes | Octal system |
---|---|---|
Folder | rwx r-x r-x | 755 |
File | rw- r-- r-- | 644 |
Directory and file permissions and selected PHP settings
If you are having problems creating or uploading files with a content management system or other PHP script installed for your hosting account, check whether you are using PHP in FastCGI mode before you manually change any permissions. This saves you the trouble of having to manually change permissions in most cases.
File permissions for Perl scripts
Executing Perl scripts (.pl files) normally requires rwx r-x r-x (755) permissions.
After uploading via FTP, the permissions must therefore be changed manually. The following section explains how this works.
Change directory and file permissions from your FTP client
If you want to change the directory and file permissions in your FTP client to match the information shown above, follow these steps:
Cyberduck
- Right-click on the directory or file you want to change.
- Select Info and then click the Permissions tab.
- Configure the permissions according to the principle described above. If you want to use CHMOD code, you can use the CHMOD calculator.
FileZilla
- Right-click on the directory or file you want to change.
- Select File permissions...
- Configure the permissions according to the principle described above. If you want to use CHMOD code, you can use the CHMOD calculator.
WinSCP
- Right-click on the directory or file you want to change.
- Select Properties.
- Under Permissions, make changes according to the principles described above. If you want to use CHMOD code, you can use the CHMOD calculator.
WS-FTP LE
- Right-click on the directory or file you want to change.
- Select Properties.
- Configure the permissions according to the principle described above. If you want to use CHMOD code, you can use the CHMOD calculator.
FTP Commander
FTP Commander does not allow you to change permissions.