Web Hosting Talk







View Full Version : big CGI problem... can you help me?


macfan
09-08-2001, 07:59 AM
Hi all,

I want to use the MailForm.pl script, but I get an Internal Server Error (500) when I try to execute it. Tried several things, but nothing works.:bawling: I think I configured the script correctly.

I use a Mac, configured the script in SimpleText and uploaded it into my cgi-bin (using text mode and chmod 755).

Sorry to bother you with this, but it seems that my host is not very willing to help me out here (IF they send me an answer, it's completely useless) :crying:

To have the MailForm.pl script working is very important to me.
Thank you in advance for your help!

Marco

(SH)Saeed
09-08-2001, 09:04 AM
Do you have access to your log files on the server? If you do, take a look at them and see what it says about that script.

If you want, email me (ssarvi@pocketmail.com) the script and I'll take a look at it to make sure there's no errors in it.

macfan
09-08-2001, 09:22 AM
Thank you very much for your offer to help, I appreciate it very much!

Marco

MikeM
09-08-2001, 09:44 AM
Just curious, IS the path to perl correct.... are you trying to run it on a windows server or unix(linux)

Did you modify the script in anyway.........
Are the permissions correct on your CGI-bin ???(755)

macfan
09-08-2001, 09:51 AM
Hello Mike,

I checked the path to perl several times and it looks OK to me. The site is hosted on a UNIX server. I modified the script following the instructions from the manual.

I think the permissions on my CGI-BIN are correct (isn't chmod 755 the only way to go with scripts? - I'm a newbie...)

Marco

MikeM
09-08-2001, 09:55 AM
yup, should work.... what mod's did you make to the script???
Have you tryed a fresh copy of it??

Do you have aim??

macfan
09-08-2001, 10:06 AM
eh... what is AIM? :cartman:

MikeM
09-08-2001, 10:09 AM
Lol AOL instant messenger.... its the only chat program i have at work

macfan
09-08-2001, 10:19 AM
I see! No, I don't have that.:crying:

macfan
09-08-2001, 10:23 AM
Mr Amazon looked at my script, and told me to remove some empty lines at the top of the script. And he said there were no syntax errors so now I know the script itself is OK (thanks for the advice).

Unfortunately the Internal Server Error message is still there :(
Someone else has a clue?

(SH)Saeed
09-08-2001, 11:46 AM
Here are a few things that I thought could cause the this error. Maybe anyone can add to this?

1. Make sure it's uploaded as ASCII
2. Make sure it's set to chmod 755
3. If I'm not misstaking, the directory it's in should also be set to chmod 755.
4. Make sure you have access to run CGI in that directory (a lot of host only let you run CGI from cgi-bin dir)
5. Make sure the path to Perl and Sendmail are correct
6. Log in to your server with shell (Telnet/SSH) and type "perl -c -w formmail.pl" to check it for syntax errors (just incase)

I really think the host should be involved in this case..

MikeM
09-08-2001, 11:59 AM
short of getting a new copy of the script, making any changes required in notepad and re-uploading i cant think of anything

macfan
09-08-2001, 12:25 PM
I agree that my host should be involved. I e-mailed them three times with the same question, but they simply don't reply (my original post was sent 5 days ago - I think a host should reply within 24 hours). Moving to another host could be an option, but I just signed up a few weeks ago...

Lawrence
09-08-2001, 10:16 PM
Make sure that the path to perl isn't followed by a carriage return line ending (make sure its \n not \r\n), that can be a silent killer. ASCII mode should have gotten rid of one if it was there, but it's worth a check anyway. Editing with SimpleText may have inserted one (I'm not familiar with the program, however).

Just to remove Mr Amazon's uncertainty - yes, the directory should be chmodded to 755 as well.

Félix C.Courtemanche
09-08-2001, 10:23 PM
With your FTP client, go in your acount's cgi-bin directory, right-click on the perl script and select 'CHMOD' or something like 'File Permission'

Enter 755 in there, or all read, all execute, owner write access

If that does not do it, try to see if any cgi scripts execute on your account, you may have a config problem from your ISP.

You can use this script:

http://hydrogen.can-host.com/files/testmycgi.zip

to check if there are any errors in your file as well.

Good luck...

cactus
09-09-2001, 12:30 AM
From experience, the possible causes may be:

1) Test the script on another server to check whether it's working. If it is working, then you have pinpoint the problem.

2) Run your script outside the cgi-bin folder (change the path in your script to point to it, outside the cgi-bin) If it works, then you most probably can use it but it's a security risk and not advisable.

3)Some servers allow you to run your script in cgi-bin or in all folders/directories and some server configuration, scripts don't work inside the cgi-bin folder and it only works in the other folders/directories.

4)Upload a fresh script again(sometimes files get corrupted) and do the proper chmod ... cgi-bin(755) .. file(755) and upload in ascii mode and also check the path to perl, sendmail, script security(to prevent anyone linking to script at your bandwidth expense.

Please read the "readme file for formail" which is self-explanatory as the other have recommended

hope this helps.

macfan
09-09-2001, 10:53 AM
Thanks everyone for your suggestions. I'm gonna try them all. Great to see that so many people on WHT are willing to help. :)

Marco