|
|
May-17-2008 12:50 AM |
![]() |
|||||||||||||||||||||||||||||||||||||
File Permissions: A Guide for the UninitiatedAre you getting a file permissions error when you try to execute a script on your Web server? Here's a handy guide that explains how to change file permissions and how to set them for scripts.Here's how it works: A script must be "executable" in order for it to be able to run. To make it executable you have to change the permissions of the file. You need to Telnet to the Web server, and go to the directory where the script is (probably /usr/home/your-login/www/cgi-bin). If you type: ls -lat the prompt you will see the list of files in the cgi-bin directory and on the left side it shows the permissions for each of the files, i.e. for FormMail.pl it might show: -rw-r--r-- 1 joeblow users 24261 Nov 17 18:59 FormMail.plPermissions (on the far left) are like this: 1 2 3 -rwxrwxrwxColumn 1 is for the owner of the file (joeblow) Column 2 is for the other members of the file's group (users) Column 3 is for all others r means readable w means writable x means executable read (r) = 4 write (w) = 2 execute (x) = 1 So... rwx = 7 (4 + 2 + 1) r-x = 5 (4 + 1) rw- = 6 (4 + 2) r-- = 4 (4) To change file permissions you use the command called chmod (it means "change mode"). The syntax of the command is: chmod <number> <filename>i.e. To change the file permissions for the file called "textfile.txt" to Readable, writable, executable by the owner (7) Readable, executable by the group (5) Readable by everyone else (4) type: chmod 754 textfile.txtScripts are usually set to 755: Readable, writable, executable by the owner (7) Readable, executable by the group (5) Readable, executable by everyone else (5) So if you are trying to run the FormMail.pl script you'd need to type: chmod 755 FormMail.plto get it to become: -rwxr-xr-x 1 joeblow users 24261 Nov 17 18:59 FormMail.plIf you are still getting errors after changing your file permissions, contact us for support anytime.
|
|
|||||||||||||||||||||||||||||||||||||||
|
[Home] [Services] [Support] [About] [Berkeley!] [Site
Map] [Webmail] © 2008 by LMi.net. All Rights Reserved. |
||||||||||||||||||||||||||||||||||||||||