Results 1 to 4 of 4
Simple Appearing But Baffling Error Forum: ASP ForumReplies: 1
DB-Library error: General SQL Server error: Check messages from the SQL Server. Forum: General DiscussionReplies: 0
Unexpected Error on Simple UPDATE Query Forum: PHP ForumReplies: 8
Server error Forum: ASP ForumReplies: 2
server error. please help Forum: ASP ForumReplies: 2
02-09-2005, 05:37 PM #1
500 server error with VERY simple cgi??!!
I've been trying to install formmail.cgi on my site and have had 8 hours of headache... so I'm reaching out in the hope of some help. I'm pretty much a newbie, but have successfully tinkered with cgi before. The interface for this new hosting account is different to my previous ones (all cpanel), so it could be something really obvious that I just haven't come across before...
Anyway, I keep getting a 500 internal server error every time I call the script.
I am allowed run cgi on my hosting account, the path to perl is correct, I uploaded in ASCII and set permissions to 755. (Even tried 777 just to see if it would help - it didn't).
I only altered the few variables needed in FormMail. But to be sure it wasn't the script, as a tester I put a very simple "HelloWorld" script into the mainwebsite_cgi directory. Same thing, 500 error. In the error log, it comes up "premature end of script headers".
What have I done wrong? Any pointers or ideas?
Any help would be very very very gratefully received!
www.theretropostershop.com (as soon as I get this sorted anyway...)
Just in case it helps, here are some details:
The script is:
print "Content-type: text/html\n\n";
print "Hello World!\n";
I'm using the following URL to call the script:
02-09-2005, 06:46 PM #2
Hi, welcome to the forums.
I hate "Premature end of script header" as its so vague. C'est la vie with CGI though, love it or hate it.
One thing that caught me once, is the #!/path/to/perl line the very first line in the script? No space above it at all?If one of our members helps you, please click the icon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
02-09-2005, 06:54 PM #3
insert this code right after the path to perl
use CGI::Carp qw(fatalsToBrowser);
You should remove the code above once you get the error message.
02-15-2005, 07:02 AM #4
Thanks a lot to both of you for your help. For some reason I only just got the email telling me there was a new post... so sorry for the delay in responding.
I actually got it sorted.... though the answers sort of embarrassing... I was uploading into the wrong directory.
Before I've always had my cgi-bin in the public_html folder. I've created it myself and uploaded it in the same way as the rest of the site. I was trying to call it from the self created directory which didn't work - I needed to put it into the one set aside by the hosts, which resides in a different directory altogether.
Funny that no matter how impossible these things seem, they always manage to come right in the end! Thanks again, I can see myself using this forum quite a bit...