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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Computer101Connect With a Mentor Commented:
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
All Courses

From novice to tech pro — start learning today.