33 users online (0 members and 33 guests)  


  Results 1 to 4 of 4

Related

  1. Simple Appearing But Baffling Error    Forum: ASP Forum
    Replies: 1
  2. Replies: 0
  3. Unexpected Error on Simple UPDATE Query    Forum: PHP Forum
    Replies: 8
  4. Server error    Forum: ASP Forum
    Replies: 2
  5. server error. please help    Forum: ASP Forum
    Replies: 2
  1. #1
    martin(rps)'s Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2005
    Location
    notts uk
    Posts
    7

    Question 500 server error with VERY simple cgi??!!

    Hi All,

    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!

    Thanks. Martin

    www.theretropostershop.com (as soon as I get this sorted anyway...)


    Just in case it helps, here are some details:

    The script is:

    #!/usr/bin/perl

    print "Content-type: text/html\n\n";

    print "Hello World!\n";

    I'm using the following URL to call the script:

    http://www.theretropostershop.com/cgi-bin/HelloWorld.cgi

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    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?

  3. #3
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    insert this code right after the path to perl
    Code:
    use CGI::Carp qw(fatalsToBrowser);
    then point your browser back at the page and tell us what error it is giving you.

    You should remove the code above once you get the error message.

    Dave

  4. #4
    martin(rps)'s Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2005
    Location
    notts uk
    Posts
    7

    delayed response...

    Hi there,

    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...



Tags for this Thread