Error with CGI script

Discussion in 'Internet Discussion' started by Suzanne, Feb 14, 2004.

  1. Suzanne

    Suzanne <b>VIP Member</b>

    Messages:
    452
    Can anyone tell me what "Premature end of script headers" might mean? I'm trying to install a cgi script and it's not working :(
     
  2. ian

    ian Administrator Staff Member

    Messages:
    12,018
    It could possibly be that the permission settings (eg CHMOD 755) are not correctly set.
    Also the script files need to be uploaded in ASCII.
     
  3. ian

    ian Administrator Staff Member

    Messages:
    12,018
    Did you make sure that the perl path was correct? Did you use notepad to edit the file?
     
  4. whatsmydingo

    whatsmydingo New Member

    Messages:
    81
    whenever I got that error it meant that I either forgot my #! or
    print "Content-type:text/html\n\n";
     
  5. zkiller

    zkiller <b>VIP Member</b>

    Messages:
    781
    make sure the line at the very top of the script, that declares where perl is, is correct.
     
  6. Christopher

    Christopher VIP Member

    Messages:
    1,356
    Double check the path to perl is correct (as ian said). Should look like this (at the very top, as z has suggested):
    Code:
    #!/usr/bin/perl
    Your host may be different though, look through your hosts FAQ or ask them.

    Then make sure it's CHMOD'd to 755 and uploaded in ASCII as ian said and ensure the directory is also CHMOD'd to 755.

    But that error should mean that your headers weren't sent properly, make sure you found the line that whatsmydingo said. It might have "\n\r\n\r" instead of "\n\n".
     
  7. Suzanne

    Suzanne <b>VIP Member</b>

    Messages:
    452
    Thanks guys, as far as I know all of that was done right so I've given up with that script :( I hate CGI scripts.
     
  8. whatsmydingo

    whatsmydingo New Member

    Messages:
    81
    If you want I can try and help you out, personally I like perl :D :cool:
     
  9. Christopher

    Christopher VIP Member

    Messages:
    1,356
    You sure you had it in your cgi-bin?
     
  10. whatsmydingo

    whatsmydingo New Member

    Messages:
    81
    I could be wrong, but I wouldn't think that the script would return perl runtime errors if it were outside the script zone. But I could be wrong.
     
  11. Christopher

    Christopher VIP Member

    Messages:
    1,356
    Ah, thats true. But hey nothing else seems to be workign :p
     
  12. whatsmydingo

    whatsmydingo New Member

    Messages:
    81
    well my offer still stands - if you want I can take a look at it. Sometimes it's easier to see what's wrong if I can actually see it :p
     
  13. ian

    ian Administrator Staff Member

    Messages:
    12,018
    Is it a well known script? I wouldnt give up, as a very last resort, I would try deleting everything and start all over again.
     
  14. Suzanne

    Suzanne <b>VIP Member</b>

    Messages:
    452
    Thanks dingo I'll take you up on that offer if I decide to use it. :D I'm trying out a free one now (I paid $70 for the non working one grrr) and it seems to be ok but I might change my mind again once I've tested it properly.

    The one I didn't manage to get working was a link indexing script (the sql one) from www.mrcgiguy.com it looks good but the installation just has me totally discouraged from using it :( So I'm trying out Linker from http://enproject.codelib.co.kr/ which is php and installing was a breeze lol
     
  15. Christopher

    Christopher VIP Member

    Messages:
    1,356
    If you payed for the script, didn't it come with support?
     
  16. ian

    ian Administrator Staff Member

    Messages:
    12,018
    I like software which has a support forum.
     
  17. Christopher

    Christopher VIP Member

    Messages:
    1,356
    lol Sorry, that comment just seemed random to me... Heheheh.

    But I agree :)
     
  18. whatsmydingo

    whatsmydingo New Member

    Messages:
    81
    Support forums are nice, but the for software that I have that has a support forum, the people in it always seem to know that there's a problem, but no one really seems to know how to fix it. Then after a while of people saying there's a problem, or the programmers saying they recognize there's a problem, the moderators lock the forum =Þ
     
  19. zkiller

    zkiller <b>VIP Member</b>

    Messages:
    781
    if you paid 70 bucks for the script, it had better work!!!!
     

Share This Page