Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 11234
  • Last Modified:

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!
0
psycho_cat_69
Asked:
psycho_cat_69
1 Solution
 
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
 
psycho_cat_69Author Commented:
Sorry People...I've found my problem...

Error in my CGI...

Thanx for  your help!
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 
Computer101Commented:
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now