Solved

C/CGI Premature end of script headers

Posted on 2004-08-18
7
11,225 Views
Last Modified: 2013-12-25
Hi,

I have the following message in the error_log of my apache:
                        "Premature end of script headers: search.cgi"

i've chmoded 755 on my cgi-script.
My script run well if i call it from the browser directly but not from my php page.
My Php returns: "failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error"

I use Apache 2.0.50  /  Red Hat 8 /  PHP 5  /  CGI programmed in C Language

Thanx for your help!
0
Comment
Question by:psycho_cat_69
7 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
beside that it is a very bad idea to call a cgi from within another cgi ...

could you please post the PHP call
0
 
LVL 5

Expert Comment

by:Peewee
Comment Utility
psycho_cat_69,

is your script on a server we can see?  if so paste the url here for your php and your cgi file..

Peewee
0
 
LVL 1

Author Comment

by:psycho_cat_69
Comment Utility
Sorry People...I've found my problem...

Error in my CGI...

Thanx for  your help!
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> My script run well if i call it from the browser directly
and
> Error in my CGI...
how could it then run first?
0
 
LVL 1

Author Comment

by:psycho_cat_69
Comment Utility
Something with netscape validation!  I've removed those lines and then everything was OK!

Bizar!

********************************************************
********************************************************
Lines removed:

int netscape=0

if(!strstr(getenv("HTTP_USER_AGENT"), "MSIE"))
               netscape=1

********************************************************
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
Comment Utility
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now