webserver accessing problem-Premature end of script headers

Sub: Premature end of script headers


Can someone please advice on the following problem I am facing.

We are trying to integrate license management software with our application. This involves a license server and the license client (which is integrated with our application). I have been able to integrate the license client successfully. On the server side, it involves placing a couple of binary files in the cgi-bin directory of the webserver.

Firstly, I placed these files in a locally configured webserver and the s/w worked perfectly over the local LAN. When I tried the same thing over a web server (via the internet) the s/w did not work. On checking the apache log files, I came across the error as

“Premature end of script headers”

Initially I thought this might be a problem with the permission and made sure that the cgi-bin and the binary files are set to rwxr-xr-x (0755). Even after this, the same error persists.

How do I solve this?


This nearly always means your cgi program or your webapp exited before even sending out the Content-Type: text/html header. In short, your cgi program crashed, or if it’s an interpreted language like PHP, there is syntax error.