Forum Moderators: mack

Message Too Old, No Replies

Server side CGI (written in C) script problem.

Receive Premature end of script headers error in error.log

         

elars

10:22 pm on Feb 27, 2006 (gmt 0)

10+ Year Member



I started with a Fedora Core 4 box and Apache 2. I have a CGI script (written in C) and compiled with g++. I call the script from my index.html and everything works fine.

I have to move my setup to W2k3 box. I am again running Apache 2, but now am getting a "Premature end of script headers" error when my page tries to access my CGI script. I compiled this time with the Borland command line compiler. My code is unchanged from when I was using Fedora Core 4 and Apache 2.

Any ideas would be appreciated.

elars

11:49 pm on Mar 2, 2006 (gmt 0)

10+ Year Member



Found the problem!

A 2D array declaration was causing the problem. Must have been some kind of buffer overrun problem with Apache for Windows?

char a_2D_array[256][8192]
//this caused the "premature end of script headers error"

char a_2D_array[256][2048]
//no error. normal operation!