You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by uxwrstre <ux...@trashmail.net> on 2006/12/01 14:05:52 UTC

[users@httpd] Mysterious \"Premature end of script headers\" error

Hello,

I\'m using Apache 1.3.37 on Solaris 8 (SPARC architecture).
I have a simple CGI-BIN script which worked before and printed out the following:
acwebint 13:57 archive/docs/bin : ./http-goto
Location: http://acwebint/DICB

acwebint 13:57 archive/docs/bin :

I get an internal error 500 message with this script, and the log file shows the following:
[Fri Dec  1 13:33:43 2006] [error] [client 134.171.16.75] Premature end of script headers: /home/web/archive/docs/bin/http-goto

What is very mysterious is that since the apache software has been upgraded from 1.3.14 to 1.3.37 that this error appeared. But I\'m not 100% sure that its in relation with the version upgrade because many changes have been made.
Does somebody knows why this CGI-BIN is not working?
Is there maybe a new CGI standard requirement in apache 1.3.37 that it does no more allows the \"Location\" command itselfs?
How could I debug this?

Best regards,
saf

-- 
E-Mail sent with anti-spam site TrashMail.net!
Free disposable email addresses: http://www.trashmail.net/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Mysterious \"Premature end of script headers\" error

Posted by uxwrstre <ux...@trashmail.net>.
On Friday 01 December 2006 14:05, uxwrstre wrote:
> ...
> shows the following: [Fri Dec  1 13:33:43 2006] [error] [client
> 134.171.16.75] Premature end of script headers:
> /home/web/archive/docs/bin/http-goto

Hello everybody,

I found out the problem!
The problem was that the CGI-BIN C program worked perfectly in the console but 
did a segmentation fault while called by apache. It seems that this 
segmentation fault appears only if apache calls this process. I suppose that 
the cgi-bin program is buggy.
It would be good to integreate in apache in the error logfiles on cgi-bin 
program failure an output in the log files like Signal 11 SIGSEGV received or 
something like that.

-- 
Best regards,
saf

Re: [users@httpd] Mysterious \"Premature end of script headers\" error

Posted by uxwrstre <ux...@trashmail.net>.
On Friday 01 December 2006 14:15, Robert Fox wrote:
> What is the script written in? Can you run the script from the command
> line?
>
> Usually, this means that the script is not sending out a completely formed
> HTTP header, which can happen for a variety of reasons.

The script is written in C.

Here is an output:
> ps -elf | grep httpd
 8 S     http   394   388  0  41 20 70b8e758    556 704bde8c   Aug 07 ?        
0:00 /home/web/server/apache/bin/httpd -
 8 S     root   388     1  0  40 20 70bde038    473 70befbea   Aug 07 ?        
0:08 /home/web/server/apache/bin/httpd -
 8 S     http   395   388  0  41 20 70c8b5b8    556 7006e26c   Aug 07 ?        
0:00 /home/web/server/apache/bin/httpd -
 8 S     http   397   388  0  45 20 70c8a768    473 7049737c   Aug 07 ?        
0:00 /home/web/server/apache/bin/httpd -
 8 S     http   398   388  0  74 20 70c8a040    473 7006e4ec   Aug 07 ?        
0:00 /home/web/server/apache/bin/httpd -
 8 S     http   399   388  0  84 20 70c795c0    473 7006e8ac   Aug 07 ?        
0:00 /home/web/server/apache/bin/httpd -
 8 S     http 26963 26952  0  51 20 70e6aeb8    120 704a735c 11:23:26 pts/4    
0:00 grep httpd
 8 S     http 27676   388  0  40 20 70e4f5f8    475 704bcd0c   Jun 23 ?        
0:00 /home/web/server/apache/bin/httpd -
> 

> id
uid=30005(http) gid=30010(websys)
> env
...
GATEWAY_INTERFACE=CGI/1.1
QUERY_STRING=tools=%2FDICB&x=8&y=3
REMOTE_ADDR=127.0.0.1
REMOTE_HOST=acmp5.hq.lan
REQUEST_METHOD=GET
SCRIPT_NAME=/bin/http-goto2
SERVER_NAME=acwebint.lan
SERVER_PORT=80
SERVER_PROTOCOL=HTTP/1.1
SERVER_SOFTWARE=Apache/1.3.37 (Unix) mod_jk/1.2.0 mod_perl/1.29 PHP/4.3.0 
mod_ssl/2.8.28 OpenSSL/0.9.8
> ./http-goto
Location: http://acwebint/DICB

> 

And this produces error 500:
[Mon Dec  4 11:24:33 2006] [error] [client 127.0.0.1] Premature end of script 
headers: /home/web/archive/docs/bin/http-goto

This is really strange.

-- 
Best regards,
saf

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Mysterious \"Premature end of script headers\" error

Posted by Robert Fox <rf...@nd.edu>.
What is the script written in? Can you run the script from the command line?

Usually, this means that the script is not sending out a completely formed HTTP header, which can happen for a variety 
of reasons.

Rob

uxwrstre wrote:
> Hello,
> 
> I\'m using Apache 1.3.37 on Solaris 8 (SPARC architecture).
> I have a simple CGI-BIN script which worked before and printed out the following:
> acwebint 13:57 archive/docs/bin : ./http-goto
> Location: http://acwebint/DICB
> 
> acwebint 13:57 archive/docs/bin :
> 
> I get an internal error 500 message with this script, and the log file shows the following:
> [Fri Dec  1 13:33:43 2006] [error] [client 134.171.16.75] Premature end of script headers: /home/web/archive/docs/bin/http-goto
> 
> What is very mysterious is that since the apache software has been upgraded from 1.3.14 to 1.3.37 that this error appeared. But I\'m not 100% sure that its in relation with the version upgrade because many changes have been made.
> Does somebody knows why this CGI-BIN is not working?
> Is there maybe a new CGI standard requirement in apache 1.3.37 that it does no more allows the \"Location\" command itselfs?
> How could I debug this?
> 
> Best regards,
> saf
> 

-- 
-----------------------------------------------------------------------
     Robert Fox                               Systems Administrator
     University Libraries of Notre Dame       Phone: (574)631-3353
     211 Hesburgh Library                     Email: rfox2@nd.edu
     Notre Dame, IN  46556

"Sufficit tibi gratia mea nam virtus in infirmitate perficitur" - 2 Corinthians 12:9
-----------------------------------------------------------------------

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org