CGI newbie

Gooly

Junior Member
Mar 3, 2001
9
0
0
Hi, I'm a real newbie with CGI scripts. Just to learn more about it, I arranged webhosting that allows (own) CGI scripts. I downloaded a simple perl script (a guestbook) I adjusted a few parameters, like my URL and I uploaded it to my new server.
Now, after filling in the form to add to the guestbook, I get this message:


<< CGIWrap encountered an error while attempting to execute this script:

Error Message: Permission denied
Error Number: 13
This message usually indicates there is a problem with the script itself. Often this indicates either that the #! line of the script is incorrect, or the script was uploaded in binary mode instead of ascii mode. Check to make sure that the script does not have control-M's at the end of every line. That will prevent it from executing. An easy fix that takes care of this most of the time is to put '#!/.../perl --' instead of '#!/.../perl' on the first line of the script.
If you are not the owner of this script, please forward this error and the URL that caused it to the script owner. That is often the component in the URL right after /cgiwrap/.
>>


I tried every suggestion in this errormessage but nothing works :(
I read somewhere that I have to give the script &quot;CHMOD rights&quot; I understood that I have to do this with my FTP app, but i can't find how (I'm using Bulletproof FTP)
My questions are:
a) could that be the reason? (If not what could?)
b) how do I give these rights with Bulletproof FTP?
 

aerialcombat

Senior member
Feb 2, 2001
385
0
0
I'm no expert in CGI, but I've encountered a lot of problem with CGI and I've struggled to solve them and I have...

Well. I can tell you this much. the main problems are
1. the script itself is messed up.
2. the address on the top of the program is a wrong one. (usr/bin/perl stuff...)
3. You uploaded the file as binary code. You need to upload it as ASCII.
4. You didn't CHMOD it to 755.

to explain some little things... for #2, you need to ask your webhosting service for your perl info.
#3, there's an option where you can choose what to upload a file as. They usually have it preset so that .cgi or.pl files would be uploaded as ASCII. if the file is uploaded as binary, i don't the machine can recognize it so it could cause an error.
last #4, CHMOD is for level of access for the owner/group/public. respectively 7/5/5. 7 means that it's full access. you can write to it, read it, edit it, delete it and all that. 5 means read only. so what you are doing is, you're letting the public read the cgi file, but not let them edit it.

It's been a while since I've used bulletproofFTP, but it might be listed as ATTRIBUTES or something like that. you can right click on the file to see if you see anything like it. If it doesn't work, just get CuteFTP, and use that to CHMOD it to 755. I hope u can get it to work.

If there's anything wrong I said, or if you want to add anything, please do so. I'm no expert in CGI. but i AM an expert in HTML though. hehh. http://www.deejonline.com
 

Gooly

Junior Member
Mar 3, 2001
9
0
0
Ok, tnx aerialcombat, It worked. I found the 'change attributes' function in BFTP (right clicking on the remote file) and the script works :)
But now I'm to the next problem: the script always returns a 'blank fields error' even when all fields are filled in. :( I checked the fieldnames in the html form and the script, but they are still the same. I was thinking about a script error, but a lot of other people use this script and it works with them. Anybody an idea? Just to be sure, here is the original script as a .txt file, so that you can view it in your browser.
guestbook