Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

chmod help

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
Ok, I'm really new to perl, I made a cgi script and I want to use it for email forms. I made one but someone said something about setting the chmod, and I have no clue how to set that. could someone help me? The link at which the form I made is at , just use fake information and then click submit.
 
klunx
couldn't get your site up. Your problem sounds like an operating system issue not a Perl issue. On unix/linux boxes files have attributes to specify who can read, write and execute them.

Read enabled files can be read with more/less/vi or whatever, Write enabled can be written to, appended and deleted and finally executeable files can be run and in the case of directories you must have execute permission to cd into the directory.

You should be able to see the permissions by using the
Code:
ls -l
command on most unix boes. This will return something like:
Code:
-rwxr-xr-x   1 testuser      testusers        35983 May 29 15:41 testSS.pl

The bit you are interested in is:
Code:
-rwxr-xr-x   1
username usergroup
Ignore the first dash, the next nine characters are permission flags if you see an r that is a read permission, etc.. The first three are for the user that owns the file (ie username) the second three are for the group that owns the file (ie groupname) and the last three are for any other user of the system.

So for anyone to execute your perl script you need the final x showing, a - here shows they do not have permission.

Finally, chmod (change mode) is used to alter the rwx bits of the file. How you do it is unix dependent but the following should work:

Code:
chmod a+x
filename
Should make your perl script executable by anyone. (a is for anyone, x is for execute)

that might sort you out, you need to look at the man pages for chmod on your system..

Code:
man chmod | more

Loon
 
Generally if you use FTP to transfer your program to your server the execute permissions should be set correctly automatically. If the cgi-cin directory has them set properly (which is your ISP's responsibility normally, when they set up your web site) then they should be set properly on any files in that directory. The only time you usually need to worry about this is when you create execuatble files directly on the server, either through another program or with an editor like vi.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top