C/CGI Premature end of script headers

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!
LVL 1
psycho_cat_69Asked:
Who is Participating?
 
Computer101Commented:
PAQed, with points refunded (500)

Computer101
E-E Admin
0
 
ahoffmannCommented:
beside that it is a very bad idea to call a cgi from within another cgi ...

could you please post the PHP call
0
 
PeeweeCommented:
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
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
psycho_cat_69Author Commented:
Sorry People...I've found my problem...

Error in my CGI...

Thanx for  your help!
0
 
ahoffmannCommented:
> My script run well if i call it from the browser directly
and
> Error in my CGI...
how could it then run first?
0
 
psycho_cat_69Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.