The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Issue with CGI scripts: Premature end of script headers

Discussion in 'General Discussion' started by Siroro, Jul 8, 2006.

  1. Siroro

    Siroro Member

    Joined:
    Jul 5, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    whenever I try to execute (even a very simple cgi-script) I get the following: Premature end of script headers (followed by the url of the script) in teh error log.

    However, a few scripts did work, before I executed Fix Insecure Permissions (Scripts) in the WHM. (And these same, unmodified scripts work now - but the slightest change will stop it working).

    I'm absolutely stumped with wahtever the issue may be.
    Thanks for any reply.
     
  2. mrprez

    mrprez Well-Known Member

    Joined:
    Jun 14, 2002
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    16
    One thing to check is to be sure there are no blank lines after the last line in the script.
     
  3. Siroro

    Siroro Member

    Joined:
    Jul 5, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    I just checked there are no blank lines.

    Thanks for the reply - if you have any other idea what may be causing this I'd love to hear it, so I can check.
     
  4. Siroro

    Siroro Member

    Joined:
    Jul 5, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I was wondering if there any other logs I can check to see what the issue with using these cgi-scripts are stored.
    Thanks.
     
  5. RickG

    RickG Well-Known Member

    Joined:
    Feb 28, 2005
    Messages:
    238
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    North Carolina
    You might want to tail /etc/httpd/logs/error_log and/or /usr/local/apache/domlogs/domain.com while executing the script to see what kind of errors post.

    When you say "the slightest change will stop it working" how are you editing the file? Are you downloading it and then uploading back to the server? The "Premature end of script headers" can sometimes occur when you upload a script as Binary when infact it should be ASCII.
     
  6. Siroro

    Siroro Member

    Joined:
    Jul 5, 2006
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    EDIT:
    My FTP client sucks! It was uploading in binary when I chose ASCII.
    Thanks for the information it is now working correctly!
     
    #6 Siroro, Jul 9, 2006
    Last edited: Jul 9, 2006
Loading...

Share This Page