CGI program reports premature end of script headers:

Source: Internet
Author: User

During this time, I wrote a CGI program, which is also designed to cope with work. It is a simple program and always reports: premature end of script headers: This is a headache! I found some information on the Internet. Follow the information ---- first check the following information:
1. Make sure that your Apache contains mod_cgi or mod_perl modules.
2. The addhandler CGI-script. cgi option function must be enabled in the Apache configuration file.
3. cgi files can run only with 755 permissions.
4. The Perl module must exist. After configuration, the error persists! A headache! Later, I accidentally wrote a small program and tested it normally. So I returned the current program in segments. I still got this error. I just didn't find a problem. The header information is as follows:

# Define xml_head "Content-Type: text/XML; charset = UTF-8 \ r \ n"

After many experiments, I finally found the problem, and I almost fainted. I don't know much about this. In the eyes of high people, I may have made a low-level mistake and smiled!

The modification is as follows:


 

# Define xml_head "Content-Type: text/XML; charset = UTF-8 \ n"

CGI program reports premature end of script headers:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.